summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/windows/qwindowstabletsupport.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Windows QPA: Refactor the tablet codeFriedemann Kleint2018-03-281-11/+8
| | | | | | | | | | - Port to C++ 11: - Use member initialization for QWindowsTabletDeviceData - Use nullptr - Fix the debug operator for QWindowsTabletDeviceData Change-Id: I6ed1141d7064a4ea2717d36ec0bb2dceea857d46 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Windows QPA: Improve tablet mode detectionFriedemann Kleint2018-03-171-11/+21
| | | | | | | | | | | | | | | Change the code to detect mouse mode only the first packet after receiving the enter proximity event, using the current tablet position. This should prevent mis-detecting mouse mode due to lags, etc. There is a theoretical chance of failing to detect mouse mode should the positions match resulting in differing speeds of mouse/tablet positions, but this seems to be a negligible risk. Task-number: QTBUG-36937 Task-number: QTBUG-64781 Change-Id: I27ca4a17786164dc8b25c4614a88672e150d5fe3 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Windows QPA: Output more information when initializing tabletsFriedemann Kleint2018-03-101-25/+74
| | | | | | | Add a debug operator for the LOGCONTEXT. Change-Id: I93d567692f35c69687709800d80bc93487c8f906 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Windows QPA: Fix scaling of tablet coordinates for High DPI scalingFriedemann Kleint2018-03-071-2/+5
| | | | | | | | | | Determine the virtual desktop geometry in native pixels from the QPlatformScreen siblings. Use the platform window to determine the local position. Task-number: QTBUG-36937 Change-Id: Ic250f1b41d8e74099558796112dbd70a7e1f6956 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Windows QPA: Check validity of device when handling tablet leaveFriedemann Kleint2017-12-191-0/+2
| | | | | | | | | | Huion GT-191 has been observed to send spurious leave events. Amends 127483b5e30de6c1905ea3280dd45a0b7d6a3813. Task-number: QTBUG-65120 Change-Id: I5dfa003a71be137a7b40cc9c27d7cf2cada6922d Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* Merge remote-tracking branch 'origin/5.9' into 5.10Liang Qi2017-10-231-6/+16
|\ | | | | | | | | | | | | | | | | Conflicts: src/plugins/platforms/direct2d/direct2d.pro src/plugins/platforms/ios/qiosclipboard.mm src/plugins/platforms/windows/windows.pro Change-Id: Idffa03b3990bd642784f528821c5446b2e1008ef
| * Windows QPA: Fix reporting of TabletLeaveProximity eventsFriedemann Kleint2017-10-171-6/+16
| | | | | | | | | | | | | | | | | | Move the check for totalPacks below; it prevents leave notifications from being handled. Task-number: QTBUG-53628 Change-Id: I2436c51308803337e6d48ef958e03123283d4a1d Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | Fix an egregious misnaming, s/deg([XY])/rad$1/gEdward Welbourne2017-07-071-4/+4
| | | | | | | | | | | | | | | | The angles in question were in radians, not degrees; we get them from std::atan(). Change-Id: Ifd60efbd975997ffca02e45ae884fb75e59806b4 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | Use qRadiansToDegrees() and qDegreesToRadians() more widelyEdward Welbourne2017-07-051-4/+4
|/ | | | | | | | | | | | | | | | Especially in examples, where we should show off our convenience functions, prefer calling these functions over doing arithmetic with M_PI (or approximations thereto) and 180 (give or take simple factors). This incidentally documents what's going on, just by the name of the function used (and reveals at least one place where variables were misnamed; the return from atan is in radians, *not* degrees). Task-number: QTBUG-58083 Change-Id: I6e5d66721cafab423378f970af525400423e971e Reviewed-by: Jüri Valdmann <juri.valdmann@qt.io> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* Convert features.tabletevent to QT_CONFIGStephan Binner2017-06-281-4/+0
| | | | | Change-Id: Ibd7ed7f269a64afddadee70979b20f1c58398378 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* Merge remote-tracking branch 'origin/5.6' into 5.7Edward Welbourne2016-07-151-2/+2
|\ | | | | | | | | | | | | | | | | | | | | Conflicts: qmake/library/qmakeevaluator.cpp One side changed the iterator to use ranged-for, the other changed its body; they only conflicted because the latter had to add braces around the body, intruding on the for-line. Trivial resolution. Change-Id: Ib487bc3bd6e3c5225db15f94b9a8f6caaa33456b
| * QWindowsTabletSupport: fix new[]/delete mismatchMarc Mutz2016-07-111-2/+2
| | | | | | | | | | | | | | | | | | | | QScopedPointer deletes with delete, but a pointer returned from new[] needs to be deleted with delete[]. Fix by using QVarLengthArray instead of QScopedPointer(new TCHAR[]). Change-Id: I2f1f252379a9ac1ee919901b5efcec9cec31261e Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | Use QStringLiteral more judiciouslyAnton Kudryavtsev2016-07-081-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replace it with QL1S in QStringBuilder expressions and in overloaded functions. Replace patterns 'QString::number() + QStringLiteral' and 'QStringLiteral + QString::number()' with QString::asprintf. Saves some text size. Change-Id: Ib39b2332264dfc3df04e77f2c101b47a1030cef4 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | QtBase (remainder): use printf-style qWarning/qDebug where possible (I)Marc Mutz2016-03-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The printf-style version of QDebug expands to a lot less code than the std::ostream-style version. Of course, you pay in type safety (but compilers warn about it these days), you cannot stream complex Qt types and streaming QStrings is awkward, but in many cases you actually improve on readability. But the main reason is that something that's not supposed to be executed under normal operation has no business bloating executable code size. This is not an attempt at converting all qWarnings() to printf-style, only the low-hanging fruit. In this first part, replace qWarning() << "" with qWarning("..."). Had to fix broken qImDebug() definition. Instead of defining it as a nullary macro in the QT_NO_DEBUG case and as a variadic macro in the other, define it in both cases, as is customary, as a non-function macro so that overload selection works without requiring variadic macro support of the compiler. Saves e.g. ~250b in text size in QtPrintSupport on optimized GCC 5.3 AMD64 builds. Change-Id: Ie30fe2f7942115d5dbf99fff1750ae0d477c379f Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-02-241-1/+1
|\| | | | | | | | | | | | | | | | | | | | | Conflicts: src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java src/plugins/platforms/windows/qwindowsfontengine.cpp src/plugins/platforms/windows/qwindowsnativeimage.cpp tests/auto/gui/kernel/qwindow/BLACKLIST tests/auto/gui/kernel/qwindow/tst_qwindow.cpp Change-Id: I649b32b260ce0ed2d6a5089021daa0d6a8db85f7
| * Windows QPA: Fix warnings as shown by Qt Creator's Clang based code model.Friedemann Kleint2016-02-191-1/+1
| | | | | | | | | | | | | | | | Code except font, accessibility and file qwindowswindow.cpp. Task-number: QTBUG-50804 Change-Id: I40848264f9fa16eea00cf70d7be009c484c49e92 Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
* | Updated license headersJani Heikkinen2016-01-151-14/+20
| | | | | | | | | | | | | | | | | | | | | | From Qt 5.7 -> LGPL v2.1 isn't an option anymore, see http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/ Updated license headers to use new LGPL header instead of LGPL21 one (in those files which will be under LGPL v3) Change-Id: I046ec3e47b1876cd7b4b0353a576b352e3a946d9 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* | Accept concurrent input from multiple tablet devices in QGuiApplicationRomain Pokrzywka2015-11-261-3/+4
|/ | | | | | | | | | | | | | | As a follow-up to 352c357e6f0785c0775a85151d6716b47aea1006 enabling support for multiple evdevtablet plugins at runtime (one per device), we also need to adjust the way QGuiApplication handles the events received from those plugins, in particular when multiple devices are sending tablet events concurrently. Replace the static members in QGuiApplication by a vector storing the same data per-device, so tablet press/release events can be recognized independently. Change-Id: Ie0975cdb03a8f6d05903e2e2e57ceb9de73a74a4 Reviewed-by: Jake Petroules <jake.petroules@theqtcompany.com>
* Windows QPA: Fix debug operators.Friedemann Kleint2015-10-271-0/+4
| | | | | | | | | | Enclose all debug operators within QT_NO_DEBUG_STREAM, declare all public ones and make the others static. Add operators for POINT and WINDOWPLACEMENT. Task-number: QTBUG-48449 Change-Id: I33f2dba2bf486a8f5cb11f11f4e2b37cce086def Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
* Windows: set QTabletEvent's timestamp from the window system eventShawn Rutledge2015-08-241-8/+10
| | | | | | Task-number: QTBUG-39459 Change-Id: I8439846482a52b358bcdc4d8a5f6f4b9bbe55fa5 Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
* Revert "Add devicePixelRatio support to the Windows QPA plugin."Friedemann Kleint2015-07-291-7/+3
| | | | | | | | | This change reverts c47b04696a9d1dab04c4a59ed9ce4c28aa00fe98 . Task-number: QTBUG-38993 Task-number: QTBUG-46615 Change-Id: I180dcac3a65a33498b90a71bbcad5e45a12af77c Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
* Use C++ <cmath> instead of <math.h>Allan Sandfeld Jensen2015-02-161-3/+3
| | | | | | | | | | | | | | Including math.h can pollute the default namespace, and break some compilers if cmath versions of the method are declared as using. Switching to C++ math functions also greatly simplifies handling of float qreal as C++ automatically chooses the right method. [ChangeLog][QtCore][QtMath] qmath.h no longer includes math.h, so any sources depending on that indirect inclusion may fail to build. Change-Id: I4d0e331dafba354ec05dc5052e61ef4ff8d387fe Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com>
* Update copyright headersJani Heikkinen2015-02-111-7/+7
| | | | | | | | | | | | | | | | | | Qt copyrights are now in The Qt Company, so we could update the source code headers accordingly. In the same go we should also fix the links to point to qt.io. Outdated header.LGPL removed (use header.LGPL21 instead) Old header.LGPL3 renamed to header.LGPL3-COMM to match actual licensing combination. New header.LGPL-COMM taken in the use file which were using old header.LGPL3 (src/plugins/platforms/android/extract.cpp) Added new header.LGPL3 containing Commercial + LGPLv3 + GPLv2 license combination Change-Id: I6f49b819a8a20cc4f88b794a8f6726d975e8ffbe Reviewed-by: Matti Paaso <matti.paaso@theqtcompany.com>
* Update license headers and add new license filesMatti Paaso2014-09-241-18/+10
| | | | | | | | | - Renamed LICENSE.LGPL to LICENSE.LGPLv21 - Added LICENSE.LGPLv3 - Removed LICENSE.GPL Change-Id: Iec3406e3eb3f133be549092015cefe33d259a3f2 Reviewed-by: Iikka Eklund <iikka.eklund@digia.com>
* Windows QPA plugin: Streamline code to find window at a position.Friedemann Kleint2014-09-011-2/+2
| | | | | | | Task-number: QTBUG-40815 Change-Id: I0efcc2cfcafdee04bda20afa88a7f6aaabd57210 Reviewed-by: Kai Koehne <kai.koehne@digia.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* Windows: Detect Surface Pro 2 tablets.Friedemann Kleint2014-08-281-0/+2
| | | | | | Task-number: QTBUG-39571 Change-Id: I9cb7fe2dee9a0701912ea639cdcc66a198e5b65c Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
* Add devicePixelRatio support to the Windows QPA plugin.Friedemann Kleint2014-08-251-3/+7
| | | | | | | | | | | This adds support for the environment variable QT_DEVICE_PIXEL_RATIO for the Windows platform plugin. Task-number: QTBUG-38993 Task-number: QTBUG-38858 Change-Id: I6831eb6d3a09a80be7bbef46395e91531b61cc50 Reviewed-by: Alessandro Portale <alessandro.portale@digia.com> Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
* add buttons to QTabletEventShawn Rutledge2014-07-281-1/+2
| | | | | | | | | | | | | 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>
* Windows: correct tablet stylus rotation to range -180..180 degreesShawn Rutledge2014-07-281-1/+3
| | | | | | | | | | | | | | When the user holds the Wacom Art Pen straight, rotation is zero; when turning it counter-clockwise, it should have a negative angle, whereas the driver sends a positive angle multiplied by 10; when turning it clockwise it should have a positive angle up to 180, whereas the driver sends 360 * 10 going downwards towards 180 * 10. These corrections make the angle reading the same between Linux and Windows. Task-number: QTBUG-39570 Change-Id: I9f18ef6629bffa849c8d65cba02d42b21469cebc Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
* Windows: Send QTabletLeaveProximity events.Friedemann Kleint2014-07-171-13/+13
| | | | | | | | | Proximity leave comes without packets, do not bail out. Task-number: QTBUG-40019 Change-Id: I4e6b4ca13ad875bdfdcd31f86b08de4a596e76cb Reviewed-by: Oliver Wolff <oliver.wolff@digia.com> Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* Fix loss of precision warningsFrederik Gladhorn2014-05-261-2/+2
| | | | | | | | Found by http://www.viva64.com/en/b/0251 Change-Id: I2a0c3dba74fef07c3119c9e57b343a8253ee7daa Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* Windows: Add platform plugin parameter for tablet absolute range.Friedemann Kleint2014-02-271-2/+2
| | | | | | | | | | | | Make the range for detecting relative (mouse mode) configureable using -platform windows:tabletabsoluterange=50 Task-number: QTBUG-36937 Change-Id: I44f928e53cb41b246c44554ec7f71bfbdf03c147 Reviewed-by: Arthur Krebsbach <Arthur.Krebsbach@Wacom.com> Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com> Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
* Port Windows QPA plugin to new logger API.Friedemann Kleint2014-01-221-18/+12
| | | | | | | | | | | | | | | | Introduce logging categories and change most debug statements to qCDebug(). Retrieve the filter rules from the environment variable QT_QPA_VERBOSE (should be removed once the logging framework offers a more convenient way of configuring). Replace the old per-category variables controlling verboseness of the output by a single variable which can be set on the command line. Change-Id: Iae55ecdb0e150efd165b7d3e90b371f72853f194 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* Windows: Fix tablet position in relative (mouse) mode.Arthur Krebsbach2013-10-141-4/+29
| | | | | | | | | | | When in "mouse" or "relative" mode with the pen position information would not be calculated correctly resulting in a significant offset between the tablet pen location and the mouse cursor location. Logic was added to detect when the two were not in sync and use the mouse location when this happens. Change-Id: Icb7129e8cce186c0099953769e215649d9347c8e Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* Add WACOM tablet support for Windows.Friedemann Kleint2013-07-041-0/+473
Task-number: QTBUG-30008 Change-Id: I3327baecae7c5d1411bcd125411097f36460cde5 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>