From a86cd4dbeeacc42f095db5ada0f0ea59f390465c Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Thu, 7 Mar 2024 08:27:24 +0100 Subject: [PATCH] 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.5 6.2 5.15 Change-Id: Iddcd9890f0c13f4130626b0ed9c5b32f5890208d Reviewed-by: Axel Spoerl (cherry picked from commit b8f9a8681347476f4db1719b38a67d7f9d3c74be) Reviewed-by: Qt Cherry-pick Bot (cherry picked from commit be78514b206aff3152a239c188fcc4e7aba5439a) --- src/plugins/platforms/xcb/qxcbwindow.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/plugins/platforms/xcb/qxcbwindow.cpp b/src/plugins/platforms/xcb/qxcbwindow.cpp index aad878fed17..6b5532420a0 100644 --- a/src/plugins/platforms/xcb/qxcbwindow.cpp +++ b/src/plugins/platforms/xcb/qxcbwindow.cpp @@ -540,6 +540,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);