summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms
Commit message (Collapse)AuthorAgeFilesLines
...
* Disable copying and assigning of QEventVolker Hilsheimer2020-11-192-15/+21
| | | | | | | | | | | | | | Polymorphic classes should not be copied. However, we do rely on event copying in our propagation logic. So, make the members protected, don't delete them, using a dedicated macro. This way, QMutable*Event classes can be used to make copies. Remove some last usage of copying of QInputMethod(Query)Events. Change-Id: Ia0a8ae4ca9de97dcd7788ca3c6ed930b6460c43a Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* xcb: Avoid use-after-free in QXcbConnection::initializeScreens()Alexander Volkov2020-11-181-2/+4
| | | | | | | | | | | Extend the scope of the resources variable to avoid its destruction while it's still in use. Fixes: QTBUG-88512 Pick-to: 5.15 5.12 Change-Id: I3298aabc871ff455bd1203ec276e7600d3e151ef Reviewed-by: Liang Qi <liang.qi@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Correct headers to build with eglfs modulesElvis Lee2020-11-1717-27/+9
| | | | | | | | | | | | | | To build with eglfs module and gbm device integration module, some headers should consider global path, not local. This covers eglfs_kms and eglfs_kms_egldeivce device integration. Other device integrations might be future work if needed. Task-number: QTBUG-85268 Change-Id: I1bad5fbac99aa79d146e90f88b53519b09254e13 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io> Reviewed-by: Elvis Lee <kwangwoong.lee@lge.com>
* Android: Ensure windows always have a geometry on creationPiotr Mikolajczyk2020-11-171-0/+10
| | | | | | | | | | | | | | | A QWindow created without an explicit geometry needs to pick up a default geometry in the platform plugin. If the window has a maximized of fullscreen window state, it will fill the entire available geometry of the parent window (or the screen if there's not parent window). Fixes: QTBUG-69159 Fixes: QTBUG-69156 Fixes: QTBUG-69154 Pick-to: 5.15 Change-Id: If8565d92a97bb4b3fa44757e68969d54d0bc7ebe Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Adjust code format, add space after 'if'Zhang Sheng2020-11-161-1/+1
| | | | | | Change-Id: Ice081c891ff7f4b766f49dd4bd5cf18c30237acf Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> Reviewed-by: hjk <hjk@qt.io>
* QFileInfo: mark constructors as explicitGiuseppe D'Angelo2020-11-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | These look like leftovers (API flaws). Construction of QFileInfo from QString (or similar) should be not implicit, as QFileInfo construction is expensive (might hit the file system), and this may have users overlook APIs (for instance build a QFileInfo out of QDirIterator::next(), instead of using ::fileInfo(); using QDir::entryList instead of entryInfoList; etc.). Leave an opt-out mechanism to ease porting. Fix a handful of usages around qtbase, with at least a couple of them likely to be actual "sloppy" code. [ChangeLog][Potentially Source-Incompatible Changes][QFileInfo] Most QFileInfo constructors are now explicit. The QT_IMPLICIT_QFILEINFO_CONSTRUCTION macro is provided to keep old code working. Change-Id: Ic580e6316e67edbc840aa0c60d98c7aaabaf1af6 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* QChar: make construction from integral explicitGiuseppe D'Angelo2020-11-152-14/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QChar should not be convertible from any integral type except from char16_t, short and possibly char (since it's a direct superset). David provided the perfect example: if (str == 123) { ~~~ } compiles, with 123 implicitly converted to QChar (str == "123" was meant instead). But similarly one can construct other scenarios where QString(123) gets accidentally used (instead of QString::number(123)), like QString s; s += 123;. Add a macro to revert to the implicit constructors, for backwards compatibility. The breaks are mostly in tests that "abuse" of integers (arithmetic, etc.). Maybe it's time for user-defined literals for QChar/QString, but that is left for another commit. [ChangeLog][Potentially Source-Incompatible Changes][QChar] QChar constructors from integral types are now by default explicit. It is recommended to use explicit conversions, QLatin1Char, QChar::fromUcs4 instead of implicit conversions. The old behavior can be restored by defining the QT_IMPLICIT_QCHAR_CONSTRUCTION macro. Change-Id: I6175f6ab9bcf1956f6f97ab0c9d9d5aaf777296d Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Windows QPA: Fix a warning about deprecated conversion of keysFriedemann Kleint2020-11-121-1/+1
| | | | | | | | Use QKeyCombinaton::toCombined(). Change-Id: I829f4e88ad316a6f4f5165c1d929f2dcc83f83de Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* Remove Qt4Compatible paintingAllan Sandfeld Jensen2020-11-122-8/+2
| | | | | Change-Id: Ie54206ca9b509875568f2158e229fca9cb1860a2 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Cocoa: Allow CMD+H to hide the application when a tooltip is visibleAndy Shaw2020-11-101-1/+2
| | | | | | | | | | | Since native applications allow CMD+H to hide an application when the tooltip is visible then we should do too. Other popup windows will still block the call. Pick-to: 5.15 Fixes: QTBUG-82626 Change-Id: Ieac86d6b3cb2152a3ba82d8bd850f13bfeedb7c8 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Fix reordering warning in QEglFSIntegrationShawn Rutledge2020-11-091-2/+2
| | | | | | | | Amends 47bcc4dd4bc9f4c4d9e9e6f3198424105385994a : m_kbdMgr was moved up to the protected section, so now it must be inited first. Change-Id: Iad28900affa7ab67122c4a6d1ec9161e2e1c7697 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Support customized device discovery with udevElvis Lee2020-11-091-2/+4
| | | | | | | | | | With derived class from QDeviceDiscoveryUDev, eglfs for a platform can create own input handlers. Task-number: QTBUG-85268 Change-Id: Ib8e99b365195eff9540e7c90e14c5d269d37ad86 Reviewed-by: Elvis Lee <kwangwoong.lee@lge.com> Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* CMake: Fix iOS platform plugin not being a default pluginAlexandru Croitor2020-11-071-0/+1
| | | | | | | | | | | | It used to be a default plugin always due to a bug in the default plugin logic, but after the fix in 1b4ea4a1d826244c2711e1a5238da6440ec1b1c3 it stopped being the default one. Fix it by checking for the QT_QPA_DEFAULT_PLATFORM variable. Task-number: QTBUG-88201 Change-Id: I39caacf90ae7c6f67d2a89472d99346d7f811840 Reviewed-by: Cristian Adam <cristian.adam@qt.io>
* xcb: ensure that available glx version is greater than requested one or ↵Aleksei Nikiforov2020-11-071-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | equal to it Otherwise xcb plugin may report that it's supported and later it'd be unable to create opengl context when requested due to too low xcb protocol version available, and thus some important xcb functions missing. Without such change when Qt application is running under x2go it exits with fatal error due to mismatch in requested and supported glx protocol versions. Qt requests glx protocol version 1.4, while x2go currently reports that it support glx protocol but only version 1.2, but Qt uses functions such as glXChooseFBConfig and glXGetVisualFromFBConfig which are available only starting with glx protocol version 1.3 according to glx documentation. With this change, when Qt application is running under x2go, xcb plugin reports that it's not supported and egl plugin is used instead. And egl plugin successfully allows to work with opengl, and thus Qt application is running normally. Pick-to: 5.15 Change-Id: I5c0fb10bd328da68054bfca8e8efde1144789566 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Fix compile warningVolker Hilsheimer2020-11-061-2/+2
| | | | | | | | QInputDevice data types changed from 16 bit to int in 742de50c5ec01f93cf0e193a8a131cbd913cb787 Change-Id: Id2760b5b685e5efc14ee6f9e36e2b30a5b188cdd Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* wasm: don’t deadlock on event processingMorten Johan Sørvig2020-11-041-3/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | emscripten_async_run_in_main_runtime_thread_ schedules an async call on the on the main thread. However, the calls are ordered, also in respect to _synchronous_ calls to the main thread (for example those made during file write/flush). Making a synchronous call from a secondary thread may then cause Emscripten to service previously scheduled async calls during the synchronous call. This can cause a deadlock if: - a secondary thread makes a sync call while holding a lock, and - a previously scheduled async call attempt to acquire the same lock on the main thread. (See https://github.com/emscripten-core/emscripten/issues/10155 for sample code) Avoid this case by adding a second zero-timer async call; this way Qt should process events when the main thread becomes idle. Change-Id: I221fe4e25bbb1a56627e63c3d1809e40ccefb030 Pick-to: 5.15 Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
* Get rid of all instance usage of QFontDatabaseVolker Hilsheimer2020-11-031-3/+2
| | | | | | | | All QFontDatabase APIs are static, use them accordingly. Task-number: QTBUG-88114 Change-Id: I0e4a7508646037e6e2812611262eed8b6d7ad3de Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Remove usages of Q_FOREACHAllan Sandfeld Jensen2020-11-021-5/+5
| | | | | | | The last places outside tests, tools and qnx platform code Change-Id: I9918861888cf58bf5dbae5603febb8885fc67709 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* CMake: Regenerate qtbase projects to use correct CONFIG_MODULE_NAMEsAlexandru Croitor2020-10-305-0/+5
| | | | | | | | Also sneak in testlib's misisng QMAKE_MODULE_CONFIG values. Task-number: QTBUG-88025 Change-Id: I76a37b8d8dbf7f294f91e32a5edbc52f5c83555b Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* CMake: Regenerate qtbase projectsAlexandru Croitor2020-10-305-7/+310
| | | | | | | | | | In preparation for some further regeneration. Also modify pro2cmake to add forgotten mapping for the Qt::EglFsKmsGbmSupportPrivate module. Change-Id: I92425c566c2b275b40eec8c652496290754ac385 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Offscreen QPA: implement a native interfaceGiuseppe D'Angelo2020-10-306-17/+50
| | | | | | | | | | | | | | | | Many code paths simply expect to have a native interface available, and won't check if a plugin is returning nullptr for it. This leads to crashes or local workarounds (e.g. 3197932e6fb03fb9c0ff669af858cb94e3836d79). Instead, have offscreen implement a dummy native interface. This requires shuffling some code for the X11 integration. Pick-to: 5.15 Change-Id: I2bdceee379e4ded9b085ebbb4d03d1e074f60726 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Oliver Wolff <oliver.wolff@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Move QPolygonClipper to XCB native paintingAllan Sandfeld Jensen2020-10-294-1/+319
| | | | | | | It is the only code using it. Change-Id: I30060a63b6621ea94ae487ec93cd857117e12a46 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* [Android] Request cursor to be in proper positionTapio Oksa2020-10-291-4/+13
| | | | | | | | | | | Cursor were set to incorrect position (-1) causing first character overwrite in password field, fixed by setting position to '0' for the first character Fixes: QTBUG-85090 Pick-to: 5.15 Change-Id: Ia2333803d5fe8f274f1ad1a643e4ff5aa8556b81 Reviewed-by: Rami Potinkara <rami.potinkara@qt.io> Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* Windows QPA: Use a QSharedPointer for the touch deviceFriedemann Kleint2020-10-266-32/+27
| | | | | | | | | | For reasons of symmetry with the tablet devices. As a drive by, give it more distinct IDs. Task-number: QTBUG-46412 Change-Id: Ie667621246b26db6fdda84c5ff2455fe38633cb3 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* macOS: Remove alpha from default surface formatMorten Johan Sørvig2020-10-231-8/+1
| | | | | | | | | | | | | | | (This reverts commit 2ca1253b13e77643b3d2dd993a038ae2df882311). This allowed use to avoid backing store RGB -> RGBA conversions on the CPU back before macOS was layer backed. The conversion should be GPU accelerated now, and we can return to the cross-platform default. In addition, RGBA backingstores requires filling with transparent pixels on each paint event, which causes increased CPU usage - often for no reason if transparency effects are not used. Change-Id: Ic795128b7e474b63f44f9f4f3526d0b205652e62 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Fix QSaveFile always failing on content: URLsVolker Krause2020-10-231-2/+9
| | | | | | | | QSaveFile needs QFileInfo::isWritable() to work, which 7e5f38aec667 caused to always return false for content: URLs. Change-Id: If839331e4bd176765ed242791cb253c2064f5f6d Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* Deprecate QVariant::TypeLars Knoll2020-10-233-7/+7
| | | | | | | | | It's been obsolete for a long time already. Make sure the compiler now warns about it and remove all remaining uses in qtbase. Change-Id: I0ff80311184dba52d2ba5f4e2fabe0d47fdc59d7 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Export gbm device integration to build it outsideElvis Lee2020-10-2337-109/+275
| | | | | | | | | | | Support external build for device integration which uses kms and gbm. QKmsScreenConfig supports inheritance to consider platform specific screen configuration. Task-number: QTBUG-85268 Change-Id: Iac58898a9cf0bb1d53237a719667a6ebd53d88b9 Reviewed-by: Elvis Lee <kwangwoong.lee@lge.com> Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Make QPointer comparisons hidden friendsAllan Sandfeld Jensen2020-10-231-1/+1
| | | | | | | Reduces ADL noise. Change-Id: Id0aa4b32b7bb6d70ed9106b949452d895d9060a9 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* CMake: Check for system_xcb_xinput featureAlexandru Croitor2020-10-231-1/+1
| | | | | | | | | | | | | | When compiling the xcb qpa plugin we should check the value of the 'system_xcb_xinput' feature to decide whether to use the system library or the bundled one, instead of checking for the existence of the XCB::INPUT target. This fixes -DINPUT_bundled_xcb_xinput=yes aka -xcb-native-painting to influence what gets built into our release Linux packages. Task-number: QTBUG-86053 Change-Id: I78c5eaacb7b6bd6e46afea49189e6111e198fb27 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* name our glib event sources to ease debuggingAndreas Buhr2020-10-221-2/+3
| | | | | | | | | | | glib event sources can have a name, but it is not required. Internal to glib, it is common to give them a name, see for example https://git.io/JTZ8g . This patch gives a name to each glib event source created in qtbase. Task-number: QTBUG-84291 Change-Id: I4f04526dcec082242312e3a66da2adf37a22e626 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* [Android] Make sure expose events are emitted after window resizePiotr Mikolajczyk2020-10-212-6/+2
| | | | | | | | | | | | Expose event would not be sent when window was resized Fixes: QTBUG-69155 Pick-to: 5.15 Change-Id: I81bf2d54f830a0dabf15398e1f25b55ff7ff4479 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Rami Potinkara <rami.potinkara@qt.io> Reviewed-by: Andy Shaw <andy.shaw@qt.io> Reviewed-by: Heikki Halmet <heikki.halmet@qt.io>
* Windows QPA/WmPointer: Register tablet devices of pointer handlerFriedemann Kleint2020-10-202-13/+64
| | | | | | | Task-number: QTBUG-46412 Change-Id: Ib9b5fd6056a5474ce46c7bde53be7a12c1494611 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Windows QPA/wintab: Register tablet devicesFriedemann Kleint2020-10-202-117/+231
| | | | | | | | | | | | | | | | Inherit a class from QPointingDevice with a shared pointer to the data for a physical cursor. As a drive-by, keep the event time in QWindowsTabletSupport for leave proximity events that do not have a time associated. The previous code was relying on QWindowSystemInterface for this, which may be at odds with the tablet's time. Refactor and streamline the code a bit. Task-number: QTBUG-46412 Change-Id: I2f4fab25a49a9d9f1befbd7fc040e8eb23be71ff Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* QPA offscreen: make platform plugin configurableMorten Johan Sørvig2020-10-207-20/+144
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Add ability to load a json config file containing screen configuration at startup. The config file location is specified using platform options: -platform offscfreen:configfile=/path/to/file Config file format example: { “screens”: [ { "name", "screen-1", "x", 0, "y", 0, "width", 640, "height", 480, "dpi", 96, "dpr", 1, }, … ] } Change-Id: Iac21aaafa6d0f361bdd6f6e9168b7e68db6ae011 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* MinGW: Fix static direct2d plugin build using PCHCristian Adam2020-10-171-0/+6
| | | | | | | | | | | | | Ammends 27499d25fb6d5b12ee6f97f5a6bedcde53b2dcee The value used to create the PCHs for _WIN32_WINNT is 0x601, and qwindowspointerhandler.cpp requires for MinGW 0x603. Since the precompile header value cannot be undefined while compiling the source file, it's better not to use the PCH for this particular source file. Change-Id: I2dc10fa11f0a796c2d21d8880e32e911359f1602 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Fix the initial cursor state for the VNC pluginMagnaboscoL2020-10-171-1/+4
| | | | | | | | | Ensure that we show a cursor directly after a client connects. Fixes: QTBUG-85006 Pick-to: 5.15 Change-Id: Icb604beb1b0ca2e7efa42ac01c2aac0a3e002865 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Fix Qt6 renamingBogDan Vatra2020-10-142-5/+11
| | | | | | | Fixes sha: 1907599bfd817e00c7f42b8cb941ebf93a098e7f Change-Id: I20ece75c321835f13a605ae4d56fee1a034ca7c8 Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* Remove dead codeLars Knoll2020-10-121-1/+1
| | | | | | | This code has been deprecated in Qt 5. Change-Id: Ia8e0bc791ac1f43df7124b4f30db3d0bb9966015 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* MinGW: Fix static build using PCHCristian Adam2020-10-091-0/+6
| | | | | | | | | | | | | | | | | | The value of NTDDI_VERSION is computed from _WIN32_WINNT. It makes sense to keep these two in sync. The value used to create the PCHs for _WIN32_WINNT is 0x601, and qwindowspointerhandler.cpp requires for MinGW 0x603. Since the precompile header value cannot be undefined while compiling the source file, it's better not to use the PCH for this particular source file. These problems surface in a static build, in a regular build for some reason the PCH for plugins is not used. Change-Id: Id724490deb9c695ac00b26cd300f9d2382019ea2 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Another round of replacing 0 with nullptrAllan Sandfeld Jensen2020-10-0732-68/+68
| | | | | | | | | This time based on grepping to also include documentation, tests and examples previously missed by the automatic tool. Change-Id: Ied1703f4bcc470fbc275f759ed5b7c588a5c4e9f Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Rename the new platform APIs from QPlatformInterface to QNativeInterfaceTor Arne Vestbø2020-10-0726-41/+41
| | | | | | | | | | | | We were already using the 'native' nomenclature when referring to these kinds of APIs, e.g. when talking about native handles, or the existing QPlatformNativeInterface on a QPA level. Using 'native' for the user facing APIs also distinguishes them from the 'platform' backend layer in QPA and elsewhere. Change-Id: I0f3273265904f0f19c0b6d62471f8820d3c3232e Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Rename Android offscreen surface interfaceTor Arne Vestbø2020-10-071-1/+1
| | | | | | | | The convention for these interfaces is to not have 'platform' in their name. Change-Id: I4af831861b58dcfc2538d4206788231b9ec3a766 Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* WinTab: Switch stylus pointer type when the tablet is in the tablet proximityDmitry Kazakov2020-10-061-4/+21
| | | | | | | | | | | | | | | | | | | Some convertible tablet devices have a special stylus button that converts the stylus into an eraser. Such button can be pressed right when the stylus is in tablet surface proximity, so we should check that not only during proximity event handling, but also while parsing normal wintab packets. Make sure that we don't switch tablet pointer type while any **mapped** stylus button is pressed. Pressing the "eraser" button is reported in pkButtons, but it maps to none by CSR_SYSBTNMAP https://bugs.kde.org/show_bug.cgi?id=405747 https://bugs.kde.org/show_bug.cgi?id=408454 Pick-to: 5.15 Change-Id: I1d254f0cf79be6ceb194b1c4b314a11831f50170 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* WinTab: Fix updating tablet pressure resolution on every proximity enter eventDmitry Kazakov2020-10-061-0/+5
| | | | | | | | | | | | | The user can switch pressure sensitivity level in the driver, which will make our saved values invalid (this option is provided by Wacom drivers for compatibility reasons, and it can be adjusted on the fly). See the bug: https://bugs.kde.org/show_bug.cgi?id=391054 Pick-to: 5.15 Change-Id: I6cfdff27eaf5a587bf714871f1495a7ea150c553 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Un-special-case macOS in handling of QKeyEvent::nativeScanCode()Tor Arne Vestbø2020-10-062-11/+17
| | | | | | | | | | | | | | | | | | | | | | | In the porting from Qt 4 to Qt 5 an assumption was made in QKeyMapper that the underlying platform implementation needed the native scan code to be able to resolve the possible keymaps for an event. As a result, the macOS platform plugin started sending key events with a fake native scan code of 1, so that it would still be allowed to map key events. Which in turn led to the documentation of QKeyEvent::nativeScanCode() getting an exception for macOS. Let's clean up this by removing the original assumption, and leave it up to the platforms to decide what information from the key event is needed. QKeyMapperPrivate::possibleKeys() will still call extractKeyFromEvent as a fallback if the platform layer doesn't return any possible keys. Change-Id: I122a45bcec658c45ccc0b2c0671eb264d85d7be6 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* macOS: Prevent mapping non-keydown events to charactersTor Arne Vestbø2020-10-061-13/+21
| | | | | | | | | | The [NSEvent charactersByApplyingModifiers:] API only supports key down events, but we might get into QCocoaKeyMapper::keyMapForKey for modifier key presses as well (even if QShortcutMap::nextState tries to filter out modifier keys). Change-Id: I02f163edac2baa9052f34b4d5d31b6a627d3d85c Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* EGLFS: Don’t compute logical DPI from physical sizeMorten Johan Sørvig2020-10-068-23/+26
| | | | | | | | | | | | | | | Remove code which computes logical DPI from the screen’s physical size. Return a DPI of 100 instead (this value was previously returned if the physical size was not available), and add a matching logicalBaseDpi() implementation which gives a device pixel ratio of 1. Task-number: QTBUG-87035 Change-Id: Ib20afbbd24fd6b57c8ffb2fd697f1becba283cba Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Remove QPlatformScreen::pixelDensity()Morten Johan Sørvig2020-10-056-22/+0
| | | | | | | | | This function is no longer in use - Qt Gui now computes scale factors based on logicalDpi() and logicalBaseDpi() instead. Change-Id: Ieb4b75ef4e1563694a8e12b7cdd1f60c419d5bf2 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Windows QPA: Fix building with OpenGL disabled after "QFlags: remove ↵Martin Storsjö2020-10-051-1/+1
| | | | | | | deprecated constructor" Change-Id: Icf07bc475ba8f8f9cbe76169dc3dede9ba703292 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>