Blob Blame History Raw
From 2c48695f04b0f4b3b11ec037b13132b146cad082 Mon Sep 17 00:00:00 2001
From: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
Date: Thu, 15 Sep 2016 23:21:15 +0200
Subject: [PATCH 032/352] XCB Drop from external app: fix keyboard modifier
 state

Fix inspired by Qt 4 sources. When we get drop events that are not
coming from the same application, it's unlikely that the keyboard
modifiers are in a sensible state (the usual XCB events are not sent
during drag and drop), so set the keyboard modifier state explicitly.

Task-number: QTBUG-49645
Change-Id: I9360f2b7ffeaa5243a4dfe7ccf96df134c5d2156
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
---
 src/plugins/platforms/xcb/qxcbdrag.cpp | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/plugins/platforms/xcb/qxcbdrag.cpp b/src/plugins/platforms/xcb/qxcbdrag.cpp
index f93e420..acfb580 100644
--- a/src/plugins/platforms/xcb/qxcbdrag.cpp
+++ b/src/plugins/platforms/xcb/qxcbdrag.cpp
@@ -960,6 +960,9 @@ void QXcbDrag::handleDrop(QPlatformWindow *, const xcb_client_message_event_t *e
     } else {
         dropData = platformDropData();
         supported_drop_actions = accepted_drop_action;
+
+        // Drop coming from another app? Update keyboard modifiers.
+        QGuiApplicationPrivate::modifier_buttons = QGuiApplication::queryKeyboardModifiers();
     }
 
     if (!dropData)
-- 
2.9.3