From 9c762bfb43be1c30842094f0d14fcdf14b029031 Mon Sep 17 00:00:00 2001 From: Jan Grulich Date: Tue, 23 Jul 2019 09:55:37 +0200 Subject: [PATCH] Use qtwayland by default on Gnome Wayland sessions Resolves: bz#1732129 --- qt5-qtbase.spec | 14 +++++++++++++- qtbase-use-wayland-on-gnome.patch | 20 ++++++++++++++++++++ 2 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 qtbase-use-wayland-on-gnome.patch diff --git a/qt5-qtbase.spec b/qt5-qtbase.spec index 49bed38..0c9d46a 100644 --- a/qt5-qtbase.spec +++ b/qt5-qtbase.spec @@ -53,7 +53,7 @@ BuildRequires: pkgconfig(libsystemd) Name: qt5-qtbase Summary: Qt5 - QtBase components Version: 5.12.4 -Release: 4%{?dist} +Release: 5%{?dist} # See LGPL_EXCEPTIONS.txt, for exception details License: LGPLv2 with exceptions or GPLv3 with exceptions @@ -126,6 +126,10 @@ Patch67: https://bugreports.qt.io/secure/attachment/66353/xcberror_filter.patch # python3 Patch68: qtbase-everywhere-src-5.11.1-python3.patch +# https://fedoraproject.org/wiki/Changes/Qt_Wayland_By_Default_On_Gnome +# https://bugzilla.redhat.com/show_bug.cgi?id=1732129 +Patch80: qtbase-use-wayland-on-gnome.patch + # glibc stat ## upstream patches @@ -406,6 +410,10 @@ Qt5 libraries used for drawing widgets and OpenGL items. #patch67 -p1 -b .xcberror_filter %patch68 -p1 +%if 0%{?fedora} > 30 +%patch80 -p1 -b .use-wayland-on-gnome.patch +%endif + ## upstream patches %patch100 -p1 %patch110 -p1 @@ -1033,6 +1041,10 @@ fi %changelog +* Tue Jul 23 2019 Jan Grulich - 5.12.4-5 +- Use qtwayland by default on Gnome Wayland sessions + Resolves: bz#1732129 + * Mon Jul 15 2019 Jan Grulich - 5.12.4-4 - Revert "Reset QWidget's winId when backing window surface is destroyed" diff --git a/qtbase-use-wayland-on-gnome.patch b/qtbase-use-wayland-on-gnome.patch new file mode 100644 index 0000000..526963c --- /dev/null +++ b/qtbase-use-wayland-on-gnome.patch @@ -0,0 +1,20 @@ +diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp +index b8bfad4f16..676fdfad5e 100644 +--- a/src/gui/kernel/qguiapplication.cpp ++++ b/src/gui/kernel/qguiapplication.cpp +@@ -1376,14 +1376,7 @@ void QGuiApplicationPrivate::createPlatformIntegration() + if (sessionType == QByteArrayLiteral("x11") && !platformName.contains(QByteArrayLiteral("xcb"))) { + platformName = QByteArrayLiteral("xcb"); + } else if (sessionType == QByteArrayLiteral("wayland") && !platformName.contains(QByteArrayLiteral("wayland"))) { +- QByteArray currentDesktop = qgetenv("XDG_CURRENT_DESKTOP").toLower(); +- QByteArray sessionDesktop = qgetenv("XDG_SESSION_DESKTOP").toLower(); +- if (currentDesktop.contains("gnome") || sessionDesktop.contains("gnome")) { +- qInfo() << "Warning: Ignoring XDG_SESSION_TYPE=wayland on Gnome." +- << "Use QT_QPA_PLATFORM=wayland to run on Wayland anyway."; +- } else { +- platformName = QByteArrayLiteral("wayland"); +- } ++ platformName = QByteArrayLiteral("wayland"); + } + } + #ifdef QT_QPA_DEFAULT_PLATFORM_NAME