summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/xcb/qxcbconnection.cpp
diff options
context:
space:
mode:
authorBłażej Szczygieł <spaz16@wp.pl>2015-11-20 15:44:30 +0100
committerBłażej Szczygieł <spaz16@wp.pl>2015-11-23 13:15:10 +0000
commit436ad32f9f47787d0262c25e669b808c195c6565 (patch)
tree3d23ba0b62285e093184e88e301ce45441fc213f /src/plugins/platforms/xcb/qxcbconnection.cpp
parent39c0d16a8e11ba7523a7dbeb3b1d6ee3ddfc09e8 (diff)
xcb: Fix windows opened from keyboard are not active on Marco or Xfwm4
Windows opened from keyboard (e.g. keyboard shortcut) are not active on Marco or Xfwm4. These windows are under the window which received the key event. This patch fixes the problem by updating XCB timestamp on every key press like Qt4 does. Task-number: QTBUG-49567 Change-Id: I9ea483784ac361d0b645d0f11f643868b367ac2c Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
Diffstat (limited to 'src/plugins/platforms/xcb/qxcbconnection.cpp')
-rw-r--r--src/plugins/platforms/xcb/qxcbconnection.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/plugins/platforms/xcb/qxcbconnection.cpp b/src/plugins/platforms/xcb/qxcbconnection.cpp
index 901764bbf8..50d49ca798 100644
--- a/src/plugins/platforms/xcb/qxcbconnection.cpp
+++ b/src/plugins/platforms/xcb/qxcbconnection.cpp
@@ -1086,8 +1086,12 @@ void QXcbConnection::handleXcbEvent(xcb_generic_event_t *event)
case XCB_FOCUS_OUT:
HANDLE_PLATFORM_WINDOW_EVENT(xcb_focus_out_event_t, event, handleFocusOutEvent);
case XCB_KEY_PRESS:
- m_keyboard->updateXKBStateFromCore(((xcb_key_press_event_t *)event)->state);
+ {
+ xcb_key_press_event_t *kp = (xcb_key_press_event_t *)event;
+ m_keyboard->updateXKBStateFromCore(kp->state);
+ setTime(kp->time);
HANDLE_KEYBOARD_EVENT(xcb_key_press_event_t, handleKeyPressEvent);
+ }
case XCB_KEY_RELEASE:
m_keyboard->updateXKBStateFromCore(((xcb_key_release_event_t *)event)->state);
HANDLE_KEYBOARD_EVENT(xcb_key_release_event_t, handleKeyReleaseEvent);