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>
bb10
Andy Shaw 2024-03-07 08:27:24 +01:00
parent b8584173ab
commit b8f9a86813
1 changed files with 2 additions and 0 deletions

View File

@ -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);