summaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorJan Arne Petersen <jpetersen@openismus.com>2012-02-24 18:05:06 +0100
committerQt by Nokia <qt-info@nokia.com>2012-03-01 19:00:15 +0100
commit022ff04a6bb76f18b8b4d0a8bbcb2b21bd771546 (patch)
treebb44723c4c16bdc0fdf3c2b46b42af5ee30ced79 /src/plugins
parente51e7b851f6452ed19ae960179963559ab0b78ea (diff)
Unset _NET_WM_USER_TIME_WINDOW before destroying the window
Otherwise metacity was crashing when a QWindow was destroyed immediately after being activated, because metacity was trying to select events (XSelectInput) for the already destroyed m_netWmUserTimeWindow. Task-number: QTBUG-24492 Change-Id: Iedbe7bdd6b26110ca8bec6f33525209ae551ffd5 Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/platforms/xcb/qxcbwindow.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/plugins/platforms/xcb/qxcbwindow.cpp b/src/plugins/platforms/xcb/qxcbwindow.cpp
index 1688fdf92b..7777820e93 100644
--- a/src/plugins/platforms/xcb/qxcbwindow.cpp
+++ b/src/plugins/platforms/xcb/qxcbwindow.cpp
@@ -369,6 +369,14 @@ void QXcbWindow::destroy()
if (m_syncCounter && m_screen->syncRequestSupported())
Q_XCB_CALL(xcb_sync_destroy_counter(xcb_connection(), m_syncCounter));
if (m_window) {
+ if (m_netWmUserTimeWindow) {
+ xcb_delete_property(xcb_connection(), m_window, atom(QXcbAtom::_NET_WM_USER_TIME_WINDOW));
+ // Some window managers, like metacity, do XSelectInput on the _NET_WM_USER_TIME_WINDOW window,
+ // without trapping BadWindow (which crashes when the user time window is destroyed).
+ connection()->sync();
+ xcb_destroy_window(xcb_connection(), m_netWmUserTimeWindow);
+ m_netWmUserTimeWindow = XCB_NONE;
+ }
connection()->removeWindow(m_window);
Q_XCB_CALL(xcb_destroy_window(xcb_connection(), m_window));
}