From e67ebe8ba4f59a4554a47fa26e9c374b1022d36f Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Thu, 21 Aug 2014 10:45:27 +0200 Subject: Listen to XI2 deviceChanged events to reset last position Some drivers appears to reset their scroll positions when make the primary point. This patch listens for the device changed event and uses the information in it to update the position. Task-number: QTBUG-40829 Change-Id: If354dfde6300ceb2b81be14ea24594ab0658a6aa Reviewed-by: Alex Blasche --- src/plugins/platforms/xcb/qxcbconnection.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/plugins/platforms/xcb/qxcbconnection.h') diff --git a/src/plugins/platforms/xcb/qxcbconnection.h b/src/plugins/platforms/xcb/qxcbconnection.h index 7286b6b89b..4d0596550c 100644 --- a/src/plugins/platforms/xcb/qxcbconnection.h +++ b/src/plugins/platforms/xcb/qxcbconnection.h @@ -506,6 +506,7 @@ private: XInput2TouchDeviceData *touchDeviceForId(int id); void xi2HandleEvent(xcb_ge_event_t *event); void xi2HandleHierachyEvent(void *event); + void xi2HandleDeviceChangedEvent(void *event); int m_xiOpCode, m_xiEventBase, m_xiErrorBase; #ifndef QT_NO_TABLETEVENT struct TabletData { @@ -539,6 +540,7 @@ private: Qt::Orientations legacyOrientations; QPointF lastScrollPosition; }; + void updateScrollingDevice(ScrollingDevice& scrollingDevice, int num_classes, void *classes); void xi2HandleScrollEvent(void *event, ScrollingDevice &scrollingDevice); QHash m_scrollingDevices; #endif // XCB_USE_XINPUT2 -- cgit v1.2.3 From 76de1ac0a4cd384f608a14b5d77a8cf3ef1ec868 Mon Sep 17 00:00:00 2001 From: Alexander Volkov Date: Mon, 9 Feb 2015 17:19:14 +0300 Subject: 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 Reviewed-by: Shawn Rutledge Reviewed-by: Gatis Paeglis --- src/plugins/platforms/xcb/qxcbconnection.h | 1 + 1 file changed, 1 insertion(+) (limited to 'src/plugins/platforms/xcb/qxcbconnection.h') diff --git a/src/plugins/platforms/xcb/qxcbconnection.h b/src/plugins/platforms/xcb/qxcbconnection.h index 4d0596550c..9a73006cec 100644 --- a/src/plugins/platforms/xcb/qxcbconnection.h +++ b/src/plugins/platforms/xcb/qxcbconnection.h @@ -496,6 +496,7 @@ private: 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; -- cgit v1.2.3