diff options
author | Gatis Paeglis <gatis.paeglis@qt.io> | 2017-06-02 13:55:46 +0200 |
---|---|---|
committer | Gatis Paeglis <gatis.paeglis@qt.io> | 2018-01-03 09:24:28 +0000 |
commit | 209d8f10e4a13dc63ec8927bf67fdc858c4822e0 (patch) | |
tree | 0e2be53bb20cf818d1b062b009078d22eed65382 /src/plugins/platforms/xcb/qxcbconnection.h | |
parent | 2dedf75819d838ef1964de4b8d391655f5bde85d (diff) |
xcb: fix and optimize QXcbConnection::xi2SetMouseGrabEnabled
What was broken:
- m_xiGrab on successful ungrab (XIUngrabDevice) was never set to 'false'.
Which means that we would unnecessarily call XIAllowTouchEvents, even when
we are not grabbing (this did not have any apparent side effects).
What was non optimal:
- Redundant XIQueryDevice calls. XIQueryDevice with XIAllMasterDevices flag
already returns all required devices. Calling XIQueryDevice for every id again
does not make sense.
- Querying for master pointer info on every grab is unnecessary. Simply cache
ids of master devices whenever hierarchy changes.
What remains to be investigated some time later (or never):
The original and the re-factored code grabs all master pointer devices. Not
sure if that is the expected behavior on MPX (Multi-pointer X) systems. Could
there be two context menus, each dismissed separately? MPX concept was introduced
in XI2.0, but testing shows that this setup is not very well supported even on
modern desktop environments. Tested on Ubuntu 16.04, where multiple pointers is
enough for crashing a terminal. Also AFAIK there isn't any bug reports about
broken MPX support in Qt.
Change-Id: I53f99c6efd44abc43a0985e15cff8aae7ebba8f1
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Diffstat (limited to 'src/plugins/platforms/xcb/qxcbconnection.h')
-rw-r--r-- | src/plugins/platforms/xcb/qxcbconnection.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/plugins/platforms/xcb/qxcbconnection.h b/src/plugins/platforms/xcb/qxcbconnection.h index ded11525c1..92825acb6d 100644 --- a/src/plugins/platforms/xcb/qxcbconnection.h +++ b/src/plugins/platforms/xcb/qxcbconnection.h @@ -712,6 +712,7 @@ private: QXcbSystemTrayTracker *m_systemTrayTracker = nullptr; QXcbGlIntegration *m_glIntegration = nullptr; bool m_xiGrab = false; + QVector<int> m_xiMasterPointerIds; xcb_window_t m_qtSelectionOwner = 0; |