-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
dev-qt/qtgui: Add another upstream pending fix
Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
- Loading branch information
Showing
2 changed files
with
71 additions
and
1 deletion.
There are no files selected for viewing
64 changes: 64 additions & 0 deletions
64
dev-qt/qtgui/files/qtgui-5.15.7-xcb-correctly-disconnect-xsettings-callbacks.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
From c78370cabc56668f45bdc2e96eaa8a1565d52c85 Mon Sep 17 00:00:00 2001 | ||
From: David Edmundson <kde@davidedmundson.co.uk> | ||
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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters