summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* | | xcb: support Wacom touch devices; distinguish from tabletsShawn Rutledge2014-09-231-7/+41
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | A tablet which can also do touch will show up as several XInput devices. The touch device should be treated as a touch pad, not as a tablet. [ChangeLog][Platform Specific Changes][X11 / XCB] Wacom touch devices are not mistaken for additional graphics tablets Task-number: QTBUG-39572 Change-Id: I7a61a4c0d82925080edb0175b7d03870748f55ce Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@digia.com>
* | xcb: fix coordinates of touch pointsAlexander Volkov2014-09-051-1/+1
| | | | | | | | | | | | | | | | Fix conversion from FP1616 to qreal. Use 16-bit mask 0xFFFF instead of 8-bit mask 0xFF. Change-Id: I0ee39b2e298b7ff7d7a67981925374d6a18f1474 Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
* | Avoid crash if querying device that has gone awayAllan Sandfeld Jensen2014-08-251-2/+4
| | | | | | | | | | | | | | | | | | | | | | A device removed very fast after being inserted might disappear while we are still seting it up. We must therefore check if we indeed still get a matching device Task-number: QTBUG-40820 Change-Id: I4372fb1932264e5799f37cea0d016795e28ebed6 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@digia.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
* | xcb: set up touch devices even if debug is not turned onShawn Rutledge2014-08-211-18/+22
| | | | | | | | | | | | | | | | | | | | | | | | 59ba84d31cf17d86e615e2958fece6f6e0bbefe2 introduced a mistake. It's necessary to populate the device data structure even if we are not going to log anything. Now the accessor is renamed to touchDeviceForId and the struct is renamed to XInput2TouchDeviceData to make it more clear that it is only for touch devices. Change-Id: Iaa3cce2d6cae250318f5a200becb9de9626b6437 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@digia.com>
* | devicePixelRatio support for XCBPaul Olav Tvete2014-08-191-4/+6
| | | | | | | | | | | | | | | | | | | | This adds support for the environment variable QT_DEVICE_PIXEL_RATIO for the xcb platform plugin. Task-number: QTBUG-38858 Change-Id: I7faca2f2e7dc5c601a82b3cc08456870b3e5602d Reviewed-by: Allan Sandfeld Jensen <allan.jensen@digia.com> Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
* | xcb XInput: use categorized logging for devices and eventsShawn Rutledge2014-08-181-47/+50
| | | | | | | | | | | | | | | | | | | | [ChangeLog][Platform Specific Changes][X11 / XCB] environment variables QT_XCB_DEBUG_XINPUT and QT_XCB_DEBUG_XINPUT_DEVICES are deprecated and replaced with logging categories qt.qpa.events.input and qt.qpa.devices respectively Change-Id: I287a56de5cb9ece2ac14df6510b9aa52c864c99b Reviewed-by: Allan Sandfeld Jensen <allan.jensen@digia.com>
* | add buttons to QTabletEventShawn Rutledge2014-07-281-20/+32
|/ | | | | | | | | | | | | Until now, it has been necessary for tablet-oriented applications which care about multi-button styli to reject each tablet event and wait for the mouse event in order to know which buttons are pressed. This patch adds the new API and also the X11/xcb implementation. [ChangeLog][QtCore][Tablet support] Added buttons to QTabletEvent Task-number: QTBUG-39458 Change-Id: If2c9ec1ceacc1700a82686c5fc6f568f9111055a Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
* xcb: QTabletEvents and proximity events correctly identify the toolShawn Rutledge2014-07-111-42/+109
| | | | | | | | | | | | | | | | | | | | | | | | | The tool is enum TabletDevice reported in QTabletEvent::device(). Each type of tool for each type of tablet has an ID which needs to be mapped to this enum. The meaning of the AbsWheel valuator depends on the tool type: an airbrush sends tangentialPressure in the range -1..+1, whereas an Art Pen (RotationStylus) sends rotation in degrees. Because the evdev driver sends valuator changes individually, we have to store the current value in each TabletData::ValuatorClassInfo to ensure that each QTabletEvent has complete state information. [ChangeLog][Platform Specific Changes][X11 / XCB] QTabletEvents and proximity events correctly identify the tool in use; the meaning of certain valuators depends on the tool; and the valuators' current values are not lost between events Task-number: QTBUG-39666 Task-number: QTBUG-39573 Task-number: QTBUG-39570 Change-Id: I6be242ee57e2ad0848060e04f20c0dd08954a734 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
* Listen to touch events on the master device instead of slave.Maarten Lankhorst2014-07-021-36/+13
| | | | | | | | | | | | | | | | | | | | Listening to touch events on the master prevents pointer emulation events from being generated, alleviating the need to grab. Grabbing on the slave device is buggy, and breaks pointer emulation on all current servers that support XInput 2.2 due to a bug in the server, and will also grab unwanted touch events. For reference, see https://bugs.freedesktop.org/show_bug.cgi?id=78345 Reverts 2c65b78b400ec27e6e559829b9a970dca2df6669. The idea of enabling each touchscreen separately was introduced in 4dbf574b7acb7ae8f852219700afa95f8d568f0e; that aspect is also reverted. Change-Id: I30d36397aa4ff2fb7a8ad2bbb94c2a13abd472b4 Task-number: QTBUG-38625 Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
* XCB: Fix leak with touch devicesJoni Poikelin2014-06-201-0/+6
| | | | | | Task-number: QTBUG-39596 Change-Id: I4225d5a1ab4939280640b35d30c283f056a56519 Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* xcb: touch device mode is either Dependent or Direct, not Rel or AbsShawn Rutledge2014-06-161-2/+2
| | | | | Change-Id: Ic0091007c95c4c307485bc2d5d3e1e967b44323e Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* Support hotplugging of input devices with XInput2Allan Sandfeld Jensen2014-06-121-105/+143
| | | | | | | | | | | | | | Since we only scan for XInput2 devices on application start, we will currently miss any devices plugged in while the application is running. This patch makes QXcbConnection listen for XInput2 hierachyChanged events and use them to trigger a rescan of XInput2 devices. This fixes a regression in Qt 5.3, where the scroll wheel on hot- plugged mice does not work until the Qt application is restarted. Change-Id: I2cdc7ca24d3ab00716cedc4b22355b6e4935b184 Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
* Scrolling devices should not override touch or tablet devicesAllan Sandfeld Jensen2014-05-131-13/+33
| | | | | | | | | | | | | | | | | | XISelectEvents override any earlier set event mask for the same device ids. This may cause touch devices to stop reporting touch events if they export scroll buttons or axis. The patch checks for each scrolling device if they are also a touch devices and includes the necessary bitmask if they are, and skips any devices also recognized as tablet devices as they already capture all relevant events. In addition tablet event handling will no longer block handling of wheel button events for scroll devices with the same device id. Task-number: QTBUG-38935 Change-Id: Ifd4657beb0a0cebffe89d3470ef2bd605eb3552e Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* Assume unlabelled mouse buttons are default buttonsAllan Sandfeld Jensen2014-05-131-7/+9
| | | | | | | | | | | This patch fixes legacy wheel scrolling for XInput2 drivers that fail to label mouse buttons correctly. Task-number: QTBUG-38937 Change-Id: I659890517e749dc0039489e0b7a8c38be1065d33 Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com> Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
* Use XI2 event detail to determine changed mouse buttonv5.3.0-rc1Allan Sandfeld Jensen2014-05-051-6/+6
| | | | | | | | | | | The button state part of the XI2 events appears to be badly constructed on some devices and platforms. Even where supported the 'detail' field of the XI2 events is what we should be reading since it indicates the button the event refers to and not just the state of all buttons. Task-number: QTBUG-38169 Change-Id: Iedb7971194b3c27448b72c285a54100c511c17e4 Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* Use runtime detection of XInput 2.1 to disable legacy wheel eventsAllan Sandfeld Jensen2014-04-251-2/+44
| | | | | | | | | | Ensure we fall back to using wheel button events if xinput 2.1 scroll events are not available. Handles lack of xinput 2.1 support in the server or in the input devices drivers. Task-number: QTBUG-38169 Change-Id: Ie4ad9069f648d0ab02d8f9540ed01ad58fd9e9d8 Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* Reload lastScrollPosition on window enterAllan Sandfeld Jensen2014-04-151-0/+29
| | | | | | | | | | | | | We need the lastScrollPosition position to calculated scrolling deltas on scroll events. Since the position is tied to the device and might have changed while scroll events were send to other applications we need to reload the value when mouse focus reenters our application. Task-number: QTBUG-38274 Change-Id: Ic166648f8e7ae486288cbed339a057e3faa1ef2d Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com> Reviewed-by: Daniel Teske <daniel.teske@digia.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
* Use XInput2 scrolling events to enable smoother scrollingAllan Sandfeld Jensen2014-01-091-9/+121
| | | | | | | | | | | With this patch all wheel events will be generated by XInput2 where available. This enables higher precision and smoother scrolling especially from input devices such as touchpads on laptops. [ChangeLog][Platform Specific Changes][X11 / XCB]Support XInput2 smooth scrolling events Change-Id: I3b069ed92ad5c53e08af64baaece32de82e9b5c4 Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
* Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2014-01-061-0/+16
|\ | | | | | | Change-Id: I0b021b369725b73f09faa14b9da9e2431dc24fad
| * Avoid duplicate emulated mouse events with XInput2Allan Sandfeld Jensen2014-01-031-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | When using a touch screen on a Linux machine, we receive both touch-events and emulated mouse events from XInput, on top of that we synthesize mouse- events ourselves for the touch events. This patch grabs the touch device for touch events whenever it processes a touch-begin thereby avoiding XInput from synthesizing mouse events. Task-number: QTBUG-35157 Change-Id: I5849d5841be236d6719cd080af2e9e39eb9cdd84 Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* | Merge remote-tracking branch 'origin/stable' into devSimon Hausmann2014-01-031-45/+44
|\| | | | | | | Change-Id: Id13badc270db98806048753fd7fb658aa17f1ede
| * xcb: added env variables to show input devices and eventsShawn Rutledge2013-12-301-45/+44
| | | | | | | | | | | | | | | | | | | | export QT_XCB_DEBUG_XINPUT_DEVICES=anything to show detected input devices at startup export QT_XCB_DEBUG_XINPUT=anything to log mouse, touch and tablet events Change-Id: Id14844b68ad376740f82a36aab2c59c84d2017ab Task-number: QTBUG-35583 Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
* | Remove .values() call in foreachAlbert Astals Cid2013-12-161-1/+1
|/ | | | | | | | foreach already knows how to iterate over the values without the need to create an intermediate qlist Change-Id: Icf6bacc3472e09fde6fe3735086cea289ca0fa96 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
* Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2013-08-211-3/+5
|\ | | | | | | | | | | | | | | | | Conflicts: qmake/doc/src/qmake-manual.qdoc src/plugins/platforms/xcb/qxcbconnection_xi2.cpp src/src.pro Change-Id: I0a560826c420e46988da3776bd8f9160c365459a
| * xcb: Fix TouchPointPressed being sent multiple times.Jocelyn Turcotte2013-08-191-3/+5
| | | | | | | | | | | | | | | | | | | | | | XI2 sends events for individual touch points, but QTouchEvent sends all of them with a stationary state if they didn't change. If a touch pressed event is received, and the next XI2 event is about a different touch point, we wouldn't update the state of the previously pressed touch point. Change-Id: I1ebcbea1cea54872064ef7710e2aac7b0b41cd70 Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
* | XI2 touch support: must call deviceForId to create the deviceShawn Rutledge2013-08-161-2/+4
| | | | | | | | | | | | | | | | | | | | After change 4dbf574b7acb7ae8f852219700afa95f8d568f0e touch worked only if XI2_DEBUG is turned on. That is because it creates the QTouchDevice and calls QWindowSystemInterface::registerTouchDevice, which must be done at startup so we can receive events. Change-Id: I9446d72bc702fbd819bf26bcdc2a3d657180f642 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
* | xcb: touchpad supportShawn Rutledge2013-07-221-30/+106
| | | | | | | | | | | | | | | | | | | | | | | | Relative touch devices tend to provide a moving point for one finger, then when more points are pressed, the root_x/root_y stay stationary while the Rel X/Y valuators provide info about the movements around that point. Synthesize moving touch points from those so that gestures become possible. Behavior is now similar to that on OS X. Change-Id: I1c65fb04849d19f11c3bf166044f296d95c33da1 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
* | added maximumTouchPoints to QTouchDeviceShawn Rutledge2013-07-221-2/+3
| | | | | | | | | | | | | | This was missing information which the driver can provide. Change-Id: I2574745635d6fdf608bc5617999aec46d9312c09 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* | xcb XI2: simplify and generalize tablet detectionShawn Rutledge2013-07-051-95/+66
|/ | | | | | | | | | We're looking for any tablet which has appropriate valuators, not just Wacom tablets that have recognizable names. The name recognition was always brittle and already stopped working, probably because of changed udev rules or something like that. Change-Id: Ib3a6dfdd9972b16f08f270e3f0a1aa54d6660c9f Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* xcb: don't do mouse synthesis from touch unless we find a reasonShawn Rutledge2013-05-071-1/+13
| | | | | | | | | | | | One reason is when we are using XInput 2.2, because touch devices will then generate touch events only. For the other X11 scenarios, X11 does its own mouse emulation. QPlatformIntegration::styleHint() wasn't overridden yet. The remaining hints are TODO for now. Change-Id: I2e444a00a18b33ed840ebfa8d8218655c2c39aad Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
* Update copyright year in Digia's license headersSergio Ahumada2013-01-181-1/+1
| | | | | Change-Id: Ic804938fc352291d011800d21e549c10acac66fb Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Change copyrights from Nokia to DigiaIikka Eklund2012-09-221-24/+24
| | | | | | | | Change copyrights and license headers from Nokia to Digia Change-Id: If1cc974286d29fd01ec6c19dd4719a67f4c3f00e Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* Revert "Move QWindowSystemInterface out of qpa."Paul Olav Tvete2012-08-031-1/+1
| | | | | | | | | | | | | | This reverts commit 784a877d3cd9a1a75aca9c83146389503a966071. Conflicts: src/plugins/platforms/cocoa/qcocoawindow.mm src/testlib/qtestkeyboard.h src/testlib/qtestmouse.h src/testlib/qtesttouch.h Change-Id: Iebfed179b3eb7f30e4c95edcae5a8ad6fd50330e Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Move QWindowSystemInterface out of qpa.Stephen Kelly2012-07-191-1/+1
| | | | | | | | Public QtTest headers require it, so all unit tests would have to use private Qt headers otherwise, which is not practical. Change-Id: I5d4466ec30b6a57ebdfc34413e716e657eb51368 Reviewed-by: Girish Ramakrishnan <girish.1.ramakrishnan@nokia.com>
* handle XInput 2.2 multipoint touch eventsShawn Rutledge2012-07-161-14/+210
| | | | | Change-Id: I5c925ae3e191244c7ab9415e4ba2fe49b93dd2af Reviewed-by: Laszlo Agocs <laszlo.p.agocs@nokia.com>
* Fix some spelling errorsSergio Ahumada2012-07-111-1/+1
| | | | | | Change-Id: I19d3b2e9a5180b13deb828b55195404ef20be295 Reviewed-by: Daniel Teske <daniel.teske@nokia.com> Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* Suppress QWindowSystemInterface inclusion warnings.Girish Ramakrishnan2012-07-031-1/+1
| | | | | | | | | | | | | Since QWindowSystemInterface is now part of QPA API. The correct inclusion is: #include <qpa/qwindowsysteminterface.h> #include <qpa/qwindowsysteminterface_p.h> Bulk of the work was done by: find . -type f | xargs sed -i -e 's,#include <\(QtGui/\)\?QWindowSystemInterface>,#include <qpa/qwindowsysteminterface.h>,g' Change-Id: If75fc32611e72ef1cf58505794def375b1acf74a Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
* Basic tablet support in xcb through XI2Laszlo Agocs2012-06-281-0/+310
The Maemo-specific function have been renamed a bit to prevent them clashing with the more generic stuff. Task-number: QTBUG-25865 Change-Id: Id55693159e15d5a0c679546eb48308feb48acac9 Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>