File xcb-fix-windows-opened-from-keyboard-are-not-active.patch of Package libqt5-qtbase.2170

From 436ad32f9f47787d0262c25e669b808c195c6565 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?B=C5=82a=C5=BCej=20Szczygie=C5=82?= <spaz16@wp.pl>
Date: Fri, 20 Nov 2015 15:44:30 +0100
Subject: [PATCH] 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>
---
 src/plugins/platforms/xcb/qxcbconnection.cpp | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/plugins/platforms/xcb/qxcbconnection.cpp b/src/plugins/platforms/xcb/qxcbconnection.cpp
index 901764b..50d49ca 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);
-- 
2.6.4

openSUSE Build Service is sponsored by