Better activation check in KillWindow

If the grab keyboard fails we better do not activate the window killer
otherwise we are in an inconsistent state.

CCBUG: 323191
REVIEW: 111903
This commit is contained in:
Martin Gräßlin 2013-08-06 07:50:24 +02:00
parent ee45592d85
commit bdc1883fcf

View file

@ -52,7 +52,6 @@ void KillWindow::start()
if (m_active) {
return;
}
m_active = true;
xcb_connection_t *c = connection();
ScopedCPointer<xcb_grab_pointer_reply_t> grabPointer(xcb_grab_pointer_reply(c, xcb_grab_pointer_unchecked(c, false, rootWindow(),
@ -64,7 +63,11 @@ void KillWindow::start()
if (grabPointer.isNull() || grabPointer->status != XCB_GRAB_STATUS_SUCCESS) {
return;
}
grabXKeyboard();
m_active = grabXKeyboard();
if (!m_active) {
xcb_ungrab_pointer(connection(), XCB_TIME_CURRENT_TIME);
return;
}
grabXServer();
}