7169baff88
- Added patches from upstream: Fix-Meta-shortcuts-on-XCB.patch (qtbug#43572), Fix-detection-of-GCC5.patch, Fix-physical-DPI-and-size-for-rotated-screens-on-X11.patch (qtbug#43688), Fix-typo-in-Qt5CoreMacroscmake.patch, Make-sure-theres-a-scene-before-using-it.patch (qtbug#44509), Multi-screen-DPI-support-for-X11.patch (qtbug#43713), QSystemTrayIcon-handle-submenus-correctly.patch, Update-mouse-buttons-from-MotionNotify-events.patch (qtbug#32609, qtbug#35065, qtbug#43776, qtbug#44166, qtbug#44231), X11-devicePixelRatio-screen-mapping-fix.patch (qtbug#43713) and xcb-Dont-return-0-from-QXcbKeyboard-possibleKeys.patch (qtcreatorbug#9589) OBS-URL: https://build.opensuse.org/request/show/286573 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/libqt5-qtbase?expand=0&rev=37
73 lines
3.1 KiB
Diff
73 lines
3.1 KiB
Diff
From: Alexander Volkov <a.volkov@rusbitech.ru>
|
|
Date: Mon, 09 Feb 2015 14:19:14 +0000
|
|
Subject: xcb: Update mouse buttons from MotionNotify events
|
|
X-Git-Url: http://quickgit.kde.org/?p=qt%2Fqtbase.git&a=commitdiff&h=76de1ac0a4cd384f608a14b5d77a8cf3ef1ec868
|
|
---
|
|
xcb: Update mouse buttons from MotionNotify events
|
|
|
|
We don't receive ButtonRelease event after closing a popup
|
|
by clicking outside of the client area. Thus the internal
|
|
state of mouse buttons in the xcb plugin becomes outdated
|
|
until we receive ButtonRelease event.
|
|
|
|
This commit updates the internal state of mouse buttons
|
|
from MotionNotify events. So when a user will move a mouse
|
|
on the client area, the xcb plugin will send a mouse event
|
|
with updated buttons to Qt Gui and QGuiApplication will
|
|
detect the following mouse events correctly.
|
|
|
|
Task-number: QTBUG-32609
|
|
Task-number: QTBUG-35065
|
|
Task-number: QTBUG-43776
|
|
Task-number: QTBUG-44166
|
|
Task-number: QTBUG-44231
|
|
Change-Id: Ica334dfbf04f7ef81db86b25262328fe5da11808
|
|
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
|
|
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
|
|
Reviewed-by: Gatis Paeglis <gatis.paeglis@digia.com>
|
|
---
|
|
|
|
|
|
--- a/src/plugins/platforms/xcb/qxcbconnection.cpp
|
|
+++ b/src/plugins/platforms/xcb/qxcbconnection.cpp
|
|
@@ -818,6 +818,15 @@
|
|
qCDebug(lcQpaXInput, "xcb: released mouse button %d, button state %X", event->detail, static_cast<unsigned int>(m_buttons));
|
|
}
|
|
|
|
+void QXcbConnection::handleMotionNotify(xcb_generic_event_t *ev)
|
|
+{
|
|
+ xcb_motion_notify_event_t *event = (xcb_motion_notify_event_t *)ev;
|
|
+
|
|
+ m_buttons = (m_buttons & ~0x7) | translateMouseButtons(event->state);
|
|
+ if (Q_UNLIKELY(lcQpaXInput().isDebugEnabled()))
|
|
+ qDebug("xcb: moved mouse to %4d, %4d; button state %X", event->event_x, event->event_y, static_cast<unsigned int>(m_buttons));
|
|
+}
|
|
+
|
|
#ifndef QT_NO_XKB
|
|
namespace {
|
|
typedef union {
|
|
@@ -868,11 +877,8 @@
|
|
handleButtonRelease(event);
|
|
HANDLE_PLATFORM_WINDOW_EVENT(xcb_button_release_event_t, event, handleButtonReleaseEvent);
|
|
case XCB_MOTION_NOTIFY:
|
|
- if (Q_UNLIKELY(lcQpaXInput().isDebugEnabled())) {
|
|
- xcb_motion_notify_event_t *mev = (xcb_motion_notify_event_t *)event;
|
|
- qDebug("xcb: moved mouse to %4d, %4d; button state %X", mev->event_x, mev->event_y, static_cast<unsigned int>(m_buttons));
|
|
- }
|
|
m_keyboard->updateXKBStateFromCore(((xcb_motion_notify_event_t *)event)->state);
|
|
+ handleMotionNotify(event);
|
|
HANDLE_PLATFORM_WINDOW_EVENT(xcb_motion_notify_event_t, event, handleMotionNotifyEvent);
|
|
case XCB_CONFIGURE_NOTIFY:
|
|
HANDLE_PLATFORM_WINDOW_EVENT(xcb_configure_notify_event_t, event, handleConfigureNotifyEvent);
|
|
|
|
--- a/src/plugins/platforms/xcb/qxcbconnection.h
|
|
+++ b/src/plugins/platforms/xcb/qxcbconnection.h
|
|
@@ -496,6 +496,7 @@
|
|
void updateScreens();
|
|
void handleButtonPress(xcb_generic_event_t *event);
|
|
void handleButtonRelease(xcb_generic_event_t *event);
|
|
+ void handleMotionNotify(xcb_generic_event_t *event);
|
|
|
|
bool m_xi2Enabled;
|
|
int m_xi2Minor;
|