summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndy Shaw <andy.shaw@qt.io>2024-03-07 08:27:24 +0100
committerAndy Shaw <andy.shaw@qt.io>2024-03-08 16:12:45 +0100
commitb8f9a8681347476f4db1719b38a67d7f9d3c74be (patch)
treeb951344ffc780a3442b89395abb6ee444a8593cf
parentb8584173ab6a3fc4e034bc237b34f4968528b0f3 (diff)
XCB: Unset the connection's mousePressWindow if it's this window
In some rare cases it can delete the window before this is handled by other calls, so rather than crashing we clean up. Pick-to: 6.7 6.6 6.5 6.2 5.15 Change-Id: Iddcd9890f0c13f4130626b0ed9c5b32f5890208d Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
-rw-r--r--src/plugins/platforms/xcb/qxcbwindow.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/plugins/platforms/xcb/qxcbwindow.cpp b/src/plugins/platforms/xcb/qxcbwindow.cpp
index faeb9cd314..235de0a9e4 100644
--- a/src/plugins/platforms/xcb/qxcbwindow.cpp
+++ b/src/plugins/platforms/xcb/qxcbwindow.cpp
@@ -541,6 +541,8 @@ void QXcbWindow::destroy()
doFocusOut();
if (connection()->mouseGrabber() == this)
connection()->setMouseGrabber(nullptr);
+ if (connection()->mousePressWindow() == this)
+ connection()->setMousePressWindow(nullptr);
if (m_syncCounter && connection()->hasXSync())
xcb_sync_destroy_counter(xcb_connection(), m_syncCounter);