From f616ce4660c92a3fcb4f05663c2ab47c9defa0c3 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Wed, 30 Nov 2022 01:22:10 +0000 Subject: gentoo auto-resync : 30:11:2022 - 01:22:10 --- dev-qt/qtgui/files/qtgui-5.15.7-fix-no-dbus.patch | 94 ++++++++++++++++++++++ ...-correctly-disconnect-xsettings-callbacks.patch | 64 +++++++++++++++ 2 files changed, 158 insertions(+) create mode 100644 dev-qt/qtgui/files/qtgui-5.15.7-fix-no-dbus.patch create mode 100644 dev-qt/qtgui/files/qtgui-5.15.7-xcb-correctly-disconnect-xsettings-callbacks.patch (limited to 'dev-qt/qtgui/files') diff --git a/dev-qt/qtgui/files/qtgui-5.15.7-fix-no-dbus.patch b/dev-qt/qtgui/files/qtgui-5.15.7-fix-no-dbus.patch new file mode 100644 index 000000000000..74aa5a213cfa --- /dev/null +++ b/dev-qt/qtgui/files/qtgui-5.15.7-fix-no-dbus.patch @@ -0,0 +1,94 @@ +From 6b95957de0ca356e566ac82924b28544effb3579 Mon Sep 17 00:00:00 2001 +From: Andreas Sturmlechner +Date: Fri, 9 Sep 2022 20:13:13 +0200 +Subject: [PATCH] Replace #if QT_CONFIG(dbus) with #ifndef QT_NO_DBUS + +Signed-off-by: Andreas Sturmlechner +--- + src/gui/kernel/qguiapplication.cpp | 2 +- + .../services/genericunix/qgenericunixservices.cpp | 14 +++++++------- + 2 files changed, 8 insertions(+), 8 deletions(-) + +diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp +index 87643a3a39..e191420303 100644 +--- a/src/gui/kernel/qguiapplication.cpp ++++ b/src/gui/kernel/qguiapplication.cpp +@@ -263,7 +263,7 @@ static void initThemeHints() + + static bool checkNeedPortalSupport() + { +-#if QT_CONFIG(dbus) ++#ifndef QT_NO_DBUS + return !QStandardPaths::locate(QStandardPaths::RuntimeLocation, QLatin1String("flatpak-info")).isEmpty() || qEnvironmentVariableIsSet("SNAP"); + #else + return false; +diff --git a/src/platformsupport/services/genericunix/qgenericunixservices.cpp b/src/platformsupport/services/genericunix/qgenericunixservices.cpp +index 2abe039126..69ff0de916 100644 +--- a/src/platformsupport/services/genericunix/qgenericunixservices.cpp ++++ b/src/platformsupport/services/genericunix/qgenericunixservices.cpp +@@ -54,7 +54,7 @@ + #include + #include + +-#if QT_CONFIG(dbus) ++#ifndef QT_NO_DBUS + // These QtCore includes are needed for xdg-desktop-portal support + #include + +@@ -185,7 +185,7 @@ static inline bool launch(const QString &launcher, const QUrl &url) + return ok; + } + +-#if QT_CONFIG(dbus) ++#ifndef QT_NO_DBUS + static inline bool checkNeedPortalSupport() + { + return !QStandardPaths::locate(QStandardPaths::RuntimeLocation, QLatin1String("flatpak-info")).isEmpty() || qEnvironmentVariableIsSet("SNAP"); +@@ -392,7 +392,7 @@ private: + + QGenericUnixServices::QGenericUnixServices() + { +-#if QT_CONFIG(dbus) ++#ifndef QT_NO_DBUS + if (qEnvironmentVariableIntValue("QT_NO_XDG_DESKTOP_PORTAL") > 0) { + return; + } +@@ -417,7 +417,7 @@ QGenericUnixServices::QGenericUnixServices() + + QPlatformServiceColorPicker *QGenericUnixServices::colorPicker(QWindow *parent) + { +-#if QT_CONFIG(dbus) ++#ifndef QT_NO_DBUS + // Make double sure that we are in a wayland environment. In particular check + // WAYLAND_DISPLAY so also XWayland apps benefit from portal-based color picking. + // Outside wayland we'll rather rely on other means than the XDG desktop portal. +@@ -441,7 +441,7 @@ QByteArray QGenericUnixServices::desktopEnvironment() const + bool QGenericUnixServices::openUrl(const QUrl &url) + { + if (url.scheme() == QLatin1String("mailto")) { +-#if QT_CONFIG(dbus) ++#ifndef QT_NO_DBUS + if (checkNeedPortalSupport()) { + QDBusError error = xdgDesktopPortalSendEmail(url); + if (isPortalReturnPermanent(error)) +@@ -453,7 +453,7 @@ bool QGenericUnixServices::openUrl(const QUrl &url) + return openDocument(url); + } + +-#if QT_CONFIG(dbus) ++#ifndef QT_NO_DBUS + if (checkNeedPortalSupport()) { + QDBusError error = xdgDesktopPortalOpenUrl(url); + if (isPortalReturnPermanent(error)) +@@ -470,7 +470,7 @@ bool QGenericUnixServices::openUrl(const QUrl &url) + + bool QGenericUnixServices::openDocument(const QUrl &url) + { +-#if QT_CONFIG(dbus) ++#ifndef QT_NO_DBUS + if (checkNeedPortalSupport()) { + QDBusError error = xdgDesktopPortalOpenFile(url); + if (isPortalReturnPermanent(error)) +-- +2.38.1 + diff --git a/dev-qt/qtgui/files/qtgui-5.15.7-xcb-correctly-disconnect-xsettings-callbacks.patch b/dev-qt/qtgui/files/qtgui-5.15.7-xcb-correctly-disconnect-xsettings-callbacks.patch new file mode 100644 index 000000000000..5692ecc5379e --- /dev/null +++ b/dev-qt/qtgui/files/qtgui-5.15.7-xcb-correctly-disconnect-xsettings-callbacks.patch @@ -0,0 +1,64 @@ +From c78370cabc56668f45bdc2e96eaa8a1565d52c85 Mon Sep 17 00:00:00 2001 +From: David Edmundson +Date: Mon, 17 Oct 2022 22:18:58 +0100 +Subject: [PATCH] xcb: correctly disconnect xsettings callbacks + +registerCallbackForProperty can be initialized without us completely +initialializing a GTK theme. We need a different guard for the +destructor. + +(part cherry-picked from 012132c60d625b2de0039bdda3c22a0a8fe2dfe5) +--- + src/plugins/platforms/xcb/qxcbcursor.cpp | 8 +++++--- + src/plugins/platforms/xcb/qxcbcursor.h | 1 + + 2 files changed, 6 insertions(+), 3 deletions(-) + +diff --git a/src/plugins/platforms/xcb/qxcbcursor.cpp b/src/plugins/platforms/xcb/qxcbcursor.cpp +index 4210bf428e..0670b6ebce 100644 +--- a/src/plugins/platforms/xcb/qxcbcursor.cpp ++++ b/src/plugins/platforms/xcb/qxcbcursor.cpp +@@ -300,7 +300,7 @@ QXcbCursorCacheKey::QXcbCursorCacheKey(const QCursor &c) + #endif // !QT_NO_CURSOR + + QXcbCursor::QXcbCursor(QXcbConnection *conn, QXcbScreen *screen) +- : QXcbObject(conn), m_screen(screen), m_gtkCursorThemeInitialized(false) ++ : QXcbObject(conn), m_screen(screen), m_gtkCursorThemeInitialized(false), m_callbackForPropertyRegistered(false) + { + #if QT_CONFIG(cursor) + // see NUM_BITMAPS in libXcursor/src/xcursorint.h +@@ -343,7 +343,7 @@ QXcbCursor::~QXcbCursor() + { + xcb_connection_t *conn = xcb_connection(); + +- if (m_gtkCursorThemeInitialized) { ++ if (m_callbackForPropertyRegistered) { + m_screen->xSettings()->removeCallbackForHandle(this); + } + +@@ -562,8 +562,10 @@ xcb_cursor_t QXcbCursor::createFontCursor(int cshape) + xcb_cursor_t cursor = XCB_NONE; + + #if QT_CONFIG(xcb_xlib) && QT_CONFIG(library) +- if (m_screen->xSettings()->initialized()) ++ if (m_screen->xSettings()->initialized()) { + m_screen->xSettings()->registerCallbackForProperty("Gtk/CursorThemeName",cursorThemePropertyChanged,this); ++ m_callbackForPropertyRegistered = true; ++ } + + // Try Xcursor first + if (cshape >= 0 && cshape <= Qt::LastCursor) { +diff --git a/src/plugins/platforms/xcb/qxcbcursor.h b/src/plugins/platforms/xcb/qxcbcursor.h +index 0b238823f0..82fb47e55d 100644 +--- a/src/plugins/platforms/xcb/qxcbcursor.h ++++ b/src/plugins/platforms/xcb/qxcbcursor.h +@@ -122,6 +122,7 @@ private: + void *handle); + #endif + bool m_gtkCursorThemeInitialized; ++ bool m_callbackForPropertyRegistered; + }; + + QT_END_NAMESPACE +-- +GitLab + -- cgit v1.2.3