summaryrefslogtreecommitdiffstats
path: root/src/platformsupport
Commit message (Collapse)AuthorAgeFilesLines
* Fix Flickable not working on VxWorksKarim Pinter2025-08-254-119/+127
| | | | | | | | | | | | Forwarding evdev events individually caused multiple events to share identical timestamps, leading to Qt failing to distinguish press and release actions. This change introduces buffering and compression, similar to the Linux evdev mouse handler, to ensure accurate event timing and recognition. Task-number: QTBUG-138806 Pick-to: 6.8 6.9 6.10 Change-Id: I54aac2ae02cfbaf736b13785a36a9df8efa902c5 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Add qt.qpa.input.mouse logging category to QLibInputPointerShawn Rutledge2025-07-251-0/+7
| | | | | Change-Id: I67f0a6a2c6481cc0e71c8afe50e4fb05912c34f9 Reviewed-by: Liang Qi <liang.qi@qt.io>
* Fix incorrect condition when reading Y axis rangePawel Lopko2025-07-211-1/+1
| | | | | | | | | | | | | | | | The condition for reading the Y axis range incorrectly uses `rangeXOverride` instead of `rangeYOverride`. As a result, the range is still queried from the device even when an explicit Y range override is provided in the configuration. Additionally, overriding only range Y is ignored. Caused by commit: 276ccda2f3e96984b392c0429a5da8b804baacdf Pick-to: 6.9 6.10 Task-number: QTBUG-115777 Change-Id: I448e45b6b6c46276e02ffa2a9ee383327dc585bd Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* eglfs/kms: hot-plug and hot-reloadThomas Senyk2025-07-024-63/+467
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch extends eglfs/kms to react to events during runtime: - screens/displays getting connected ("plug in") as well as disconnected ("unplug") This is only enabled when setting QT_QPA_EGLFS_HOTPLUG_ENABLED - changes to the kms-config-file referenced by QT_QPA_EGLFS_KMS_CONFIG or QT_QPA_KMS_CONFIG eglfs will now reevaluate the connected displays and the referenced kms-config during runtime and react accordingly. Features/functionality of hot-plug: - QKmsDevice::checkConnectedScreens() (new function) will be called by QDeviceDiscovery::deviceChanged (new signal), which is fired by QDeviceDiscoveryUDev::handleUDevNotification when "change"(formerly ignored) is the action driven/created by udev - disconnected screens will be unregistered via QKmsDevice::unregisterScreen (new virtual function, this variant is empty). The code lives in the two implementations of unregisterScreen: QEglFSKmsGbmDevice::unregisterScreen will deal with global-cursor, then call it's parent variant QEglFSKmsDevice::unregisterScreen to call QWindowSystemInterface::handleScreenRemoved, feeding the information about the lost screen into the event loop - each newly connected display will be "configured" via QKmsDevice::createScreenInfoForConnector (refactored function), and then the platform class will be created via QKmsDevice::createScreen Features/functionality of hot-reload: - refactor QKmsDevice::createScreenForConnector to QKmsDevice::createScreenInfoForConnector, as the hot-reload requires to update QPlatformScreens rather then creating new ones right away - QFileSystemWatcher is added to QEglFSKmsGbmIntegration in QEglFSKmsGbmIntegration::createDevice() It will watch the file referenced by QT_QPA_EGLFS_KMS_CONFIG or QT_QPA_KMS_CONFIG When QFileSystemWatcher::fileChanged is fired, two function will be called: - KmsScreenConfig::refreshConfig(), a new function which clears the old config and calls QKmsScreenConfig::loadConfig() - QKmsDevice::updateScreens(), a new function that goes over all plugged-in and enabled screens, recreates their configuration via QKmsDevice::createScreenInfoForConnector, updates them via QKmsDevice/QEglFSKmsDevice::updateScreenOutput (new virtual), and at the end will call QKmsDevice::registerScreens (new function, see "shared changes" for details) Shared changes / necessary refactoring: - QKmsDevice::createScreens was refactored and split, where QKmsDevice::registerScreens contains code regarding screen-cloning, calling QKmsDevice::registerScreen (existing, pure virtual) and calling QKmsDevice::updateScreen (new, virtual function with one "proper" implementation in QEglFSKmsDevice::updateScreen) - Adding code regarding creation and destruction of qt_headless A replacement screen is needed when going to 0 displays, as that is not supported by Qt. This applies to all 3 cases: startup, hotplug and hotreload (while for 'startup' it will only create a headless screen if QT_QPA_EGLFS_HOTPLUG_ENABLED is set) - added "headlessSize" to kms-config to allow the user to configure the specific size of the headless "fake" screen - default value for "headlessSize" is 1024x768 (used to be 0x0) Those two changes are necessary/useful as headless is an implicit feature in this case as the fallback for when the last screen is disconnected. (In contrast to explicit 'headless' option) - a bunch of extra code regarding cloned screens, because they can now be added and removed during runtime (via screen-plug-in/out events as well as config changes) - renaming m_nonThreadedFlipMutex to s_nonThreadedFlipMutex as it's a static member - fix virtualPos to allow for 0,0 to be a valid setting (by having -1,-1 as 'is not set'-value) - QKmsDevice::registerScreens will now check if the cursor is outside the current desktopRegion. If it is, it will be repositioned to be inside (it would vanish otherwise) - adding wait-timout in waitForFlipWithEventReader to account for the fact that cloned screens can be created and added during the runtime. Without a timeout it can happen that the clonee waits forever, as the new clone can be added as a flip-dependency while it isn't scheduled to wake the clonee's wait yet Change-Id: I08421a1be156b6edb9906ef736cba149dab360ff Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Reland: CMake: Annotate some qt_find_package calls with MODULEAlexandru Croitor2025-06-242-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A qt_find_package call first tries to find a Config package with the CONFIG mode option, and if not found, falls back to an arg-less mode which searches both Config and Find modules. For some packages, we know we want to find the Find module because there can't be a Config package, e.g our FindWrap modules or any of the other Find modules we carry in our cmake directory. So we should annotate these calls with MODULE. Aside from slightly faster configuration, there is another reason to do so. Future versions of CMake will automatically log find_package calls that have a state change (e.g. Not Found -> Found) into CMakeConfigureLog.yaml. Due to the Config-first logic in qt_find_package, we always unset the Foo_DIR variable if the Config package is not found. This means that there will be a constant build up of not-found messages in the log. Explicitly annotating the calls with MODULE will prevent this. Do that. This commit relands f1a59e974f013fcf8629d8cbacab58d895523100 This reverts commit 0ce82b78a35026cb56ff76d1c24b311008934a53. Pick-to: 6.10 Change-Id: I5d37579d2f4957215ce1475b5c0ec8509d77c83d Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Revert "CMake: Annotate some qt_find_package calls with MODULE"Alexandru Croitor2025-06-192-5/+5
| | | | | | | | | | | | | | | | | | | This breaks reconfiguring Qt in various ways, one of which is CMake Error at cmake/QtTargetHelpers.cmake:1557 (message): PkgConfig::ATSPI2 is not a valid target. This happens because pkg_check_modules sets ATSPI2_FOUND to 1, so qt_find_package thinks it shouldn't find the FindATSPI2.cmake module, which ends up not creating the ATSPI2 target. This reverts commit f1a59e974f013fcf8629d8cbacab58d895523100. Pick-to: 6.10 Fixes: QTBUG-137870 Change-Id: Ica74a236c6b1bb9d7ca9af29175cb2e84a93251b Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* CMake: Annotate some qt_find_package calls with MODULEAlexandru Croitor2025-06-172-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | A qt_find_package call first tries to find a Config package with the CONFIG mode option, and if not found, falls back to an arg-less mode which searches both Config and Find modules. For some packages, we know we want to find the Find module because there can't be a Config package, e.g our FindWrap modules or any of the other Find modules we carry in our cmake directory. So we should annotate these calls with MODULE. Aside from slightly faster configuration, there is another reason to do so. Future versions of CMake will automatically log find_package calls that have a state change (e.g. Not Found -> Found) into CMakeConfigureLog.yaml. Due to the Config-first logic in qt_find_package, we always unset the Foo_DIR variable if the Config package is not found. This means that there will be a constant build up of not-found messages in the log. Explicitly annotating the calls with MODULE will prevent this. Do that. Pick-to: 6.10 Change-Id: I465b015ac18f8a09b9a5c86cec7b6312a0bfbdf1 Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* CMake: Prevent creation of empty InputSupportPrivate moduleJoerg Bornemann2025-03-251-1/+6
| | | | | | | | | | | | | | | | | | | The combination of -no-feature-evdev -no-feature-tslib -no-feature-libinput led to the creation of the InputSupportPrivate module without source files. This triggered CMake upstream issue 23464 when using CMake < 3.25. Fix this by adjusting the inexact condition that decides whether to build InputSupportPrivate. Pick-to: 6.8 6.9 Fixes: QTBUG-99957 Change-Id: If23d029f21811b6ff7c92ac9ecd2882aedb309d6 Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
* Pass VxWorks touch ranges via environment variableMichał Łoś2025-03-211-6/+35
| | | | | | | | | | | | | | | | | | Some VxWorks touch device drivers return improper value of min and max ranges in both axes (both 0 for both axes). This makes any touch point position equal to (0, 0), making touch unusable in Qt. [ChangeLog][Platform Specific Changes][VxWorks] The user can now override touch ranges that the driver returns, by setting the new parameters "rangex" and "rangey" on the environment variable QT_QPA_VXEVDEV_TOUCHSCREEN_PARAMETERS with comma-separated min and max touch ranges for X and Y axis respectively. For example, add rangex=10,815:rangey=15,1024 Pick-to: 6.9 Task-number: QTBUG-115777 Change-Id: I4f4aba7ee66e76b80438888697f84c4db9896c3d Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* QCbor/JsonValue: add toStringView()Marc Mutz2025-02-201-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is like toString(), but returns a view on the underlying string data (which may be US-ASCII (= L1), UTF-8, or UTF-16, so the return value is QASV). Use it around the code a bit. Benchmark results on my machine (with -perf -iterations 1000): PASS : BenchmarkQtJson::iteratorKey() RESULT : BenchmarkQtJson::iteratorKey(): 78,268.426 nsecs per iteration (total: 78,268,427, iterations: 1000) 349,458.080 CPU cycles per iteration, 4,46 GHz (total: 349,458,080, iterations: 1000) 780,327.957 instructions per iteration, 2,233 instr/cycle (total: 780,327,957, iterations: 1000) 173,511.019 branch instructions per iteration, 2,22 G/sec (total: 173,511,020, iterations: 1000) PASS : BenchmarkQtJson::iteratorKeyValueView() RESULT : BenchmarkQtJson::iteratorKeyValueView(): 58,424.756 nsecs per iteration (total: 58,424,756, iterations: 1000) 267,176.603 CPU cycles per iteration, 4,57 GHz (total: 267,176,604, iterations: 1000) 614,805.388 instructions per iteration, 2,301 instr/cycle (total: 614,805,389, iterations: 1000) 140,681.105 branch instructions per iteration, 2,41 G/sec (total: 140,681,106, iterations: 1000) PASS : BenchmarkQtJson::iteratorKeyView() RESULT : BenchmarkQtJson::iteratorKeyView(): 44,060.925 nsecs per iteration (total: 44,060,925, iterations: 1000) 196,344.233 CPU cycles per iteration, 4,46 GHz (total: 196,344,233, iterations: 1000) 426,631.322 instructions per iteration, 2,173 instr/cycle (total: 426,631,323, iterations: 1000) 93,703.100 branch instructions per iteration, 2,13 G/sec (total: 93,703,101, iterations: 1000) PASS : BenchmarkQtJson::iteratorKeyViewValueView() RESULT : BenchmarkQtJson::iteratorKeyViewValueView(): 29,205.569 nsecs per iteration (total: 29,205,570, iterations: 1000) 131,089.040 CPU cycles per iteration, 4,49 GHz (total: 131,089,041, iterations: 1000) 258,529.469 instructions per iteration, 1,972 instr/cycle (total: 258,529,469, iterations: 1000) 60,875.631 branch instructions per iteration, 2,08 G/sec (total: 60,875,631, iterations: 1000) [ChangeLog][QtCore][QCborValue/QJsonValue] Add toStringView() method. Fixes: QTBUG-133688 Change-Id: I4200035e995426f1cce46a73a429921a0cd56c85 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* libinput: Fix developer build without xkbcommonRobert Löhning2025-01-311-0/+2
| | | | | | | | | | Before this fix, the build failed with: error: unused variable 'REPEAT_DELAY' [-Werror,-Wunused-const-variable] error: unused variable 'REPEAT_RATE' [-Werror,-Wunused-const-variable] Pick-to: 6.9 6.8 Change-Id: I44a76e2270c1f5d8af6bd018869db5e30e40ecbb Reviewed-by: Liang Qi <liang.qi@qt.io>
* wasm: remove internal unsupported libraries from buildLorn Potter2025-01-221-2/+4
| | | | | | | | we have no access to system devices, so no need for discovery or framebuffer. Change-Id: Ie697f4b24b3a38efeff67fc670549a055da57745 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* VxWorks: Enable video device discoveryMichał Łoś2025-01-021-0/+4
| | | | | | | | | Video devices should be discovered by VxWorks properly. Pick-to: 6.8 6.9 Task-number: QTBUG-115777 Change-Id: Ib6719fc9480827aed296343e0b91286ae8408c8a Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Replace qgetenv() calls converted to QString with qEnvironmentVariable()Thiago Macieira2025-01-015-8/+8
| | | | | | | | It's slightly more efficient. Pick-to: 6.9 Change-Id: Id5ac04fc27eee108c8e5fffd786c3d5f793a0a9d Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
* libinput: Print qsizetype through %PRIdQSIZETYPEUlf Hermann2024-11-061-1/+2
| | | | | | | | | | Otherwise it's wrong where qsizetype is 32bit. Amends commit 3941fe697b9fea633f85321031ece765c532d46d. Pick-to: 6.8 Change-Id: If80b01bb188659509c42f950e803de9e1f36400a Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* Enable touchscreen discovery on VxWorksMichał Łoś2024-10-311-1/+9
| | | | | | Change-Id: I350551c398608b52c8478499aa21303916b77afa Reviewed-by: Karim Pinter <karim.pinter@qt.io> Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Introduce vxtouch pluginMichał Łoś2024-10-315-0/+1157
| | | | | | | | | | | | | | Introduce VxTouch input plugin. Due to VxWorks containing implementation of library "compatible", but not identical and with slightly different ABI, with Unix/Linux evdev, create plugin based on evdevtouch, which would be used when QT_FEATURE_vxworksevdev is detected, instead of evdev. Task-number: QTBUG-115777 Change-Id: I96405c6db2caca3c102f543f0173cfdb44dc5b2b Reviewed-by: Karim Pinter <karim.pinter@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Extract QEvdevTouchFilter to shared classesMichał Łoś2024-10-303-9/+13
| | | | | | | | | | | | | | `QEvdevTouchFilter` is not specific to evdev, but we will need it in a separate plugin. Extract this class to header in input/shared, rename it to `QTouchFilter` and add header guards. This is a preparatory change to introduce VxWorks-specific touch handler. Task-number: QTBUG-115777 Change-Id: Ia39844fe91f0d6e9f85a39f37be39b6ecdf9cda9 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io> Reviewed-by: Karim Pinter <karim.pinter@qt.io>
* Enable device discovery using VxWorks evdevMichał Łoś2024-10-304-1/+140
| | | | | | | | | | | | | | Provide VxWorks-specific implementation of keyboard and mouse device discovery, and enable usage of VxWorks evdev implementation on this platform. Note that currently code requires using VxWorks compatible mode of input devices in VxWorks, optimized mode is not supported. Task-number: QTBUG-115777 Change-Id: Ibd18c416f1c870ec02820c1001e5d129e4485dab Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io> Reviewed-by: Karim Pinter <karim.pinter@qt.io>
* Introduce VxKeyboard input pluginMichał Łoś2024-10-306-0/+1592
| | | | | | | | | | | | | | | | | | Introduce VxKeyboard plugin which is responsible for handling keyboard on VxWorks OS. Due to the fact that VxWorks is using its own, not fully compatible with Unix/Linux implementation of libevdev, it requires it's own plugin. This way, changes in evdev plugins will not be blocked/complicated by VxWorks stalled implementation. Implement VxKeyboard plugin and its backend, adding support for it in eglfs. This is a preparatory change, as there is no keyboard detection for VxWorks yet. Task-number: QTBUG-115777 Change-Id: I4ca5729c6f210fb7477bc31371a137071e12fdad Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* evdev: Do not take m_prevInvalid into account with absolute coordinatesTuomas Vaarala2024-10-301-7/+5
| | | | | | | | | | | If QT_QPA_EVDEV_MOUSE_PARAMETERS=abs is used to force qevdevmousehandler to use absolute coordinates, the first event coordinates are incorrect (0,0) Fixes: QTBUG-86104 Pick-to: 6.8 Change-Id: I9352e809a4a62b15adcf279b00f2d07a72257012 Reviewed-by: Janne Roine <janne.roine@qt.io>
* Introduce QVxMousePluginMichał Łoś2024-10-226-22/+298
| | | | | | | | | | | | | | | Since VxWorks evdev implementation should be treated as a separate entity, extract current code for handling evdev mouse and create a separate plugin which will use VxWorks version of evdev. This will allow to separate evolution of actual evdev from VxWorks. This is a preparatory change, no mouse detection will be added with this patch yet. Task-number: QTBUG-115777 Change-Id: Icb62aeca8f091f58efd3c731eb35d6a0695a591d Reviewed-by: Karim Pinter <karim.pinter@qt.io> Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Extract QEvdevKeyboardMap to shared headerMichał Łoś2024-10-185-118/+148
| | | | | | | | | | | We need `QEvdevKeyboardMap` in to-be-created plugin. Extract it to separate header in shared. This is a preparatory change. Task-number: QTBUG-115777 Change-Id: I0d646eb2f357e1f1a49be357d145eb3224987441 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Extract QKeycodeAction from QEvdevKeyboardMichał Łoś2024-10-184-39/+68
| | | | | | | | | | | | We will need this enum in newly created plugin, extract it to shared. In order to prevent exposing enum fields to Qt namespace, change `enum` to `enum class`, adjust code accordingly. This is a preparatory change. Task-number: QTBUG-115777 Change-Id: I8ea804b78dc7eb93d871f46c8fd9a2f3e83455fa Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Extract toQtModifiers to place where it belongsMichał Łoś2024-10-162-16/+17
| | | | | | | | | | | | | | `QEvdevKeyboardHandler` contains static method `toQtModifiers` which is not operating on any of its internal fields or types. This indicates that this method doesn't belong to this class, and in fact it should be moved to `QEvdevKeyboardMap` where types used in it are declared. Move this static method to `QEvdevKeyboardMap` namespace. This is a preparatory change to extract `QEvdevKeyboardMap` to separate header. Task-number: QTBUG-115777 Change-Id: Ibe88b40a56fb96772d903498611777b3ec19dded Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Extract QFdContainer from QEvdevKeyboardHandlerMichał Łoś2024-10-155-22/+59
| | | | | | | | | | | | Extract `QFdContainer` class from `QEvdevKeyboardHandler` header, as it will be used by other handlers. This is a preparatory change. Task-number: QTBUG-115777 Change-Id: Ia0a9fd905de44464322eb2e314b7e29774cece67 Reviewed-by: Karim Pinter <karim.pinter@qt.io> Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* qtslib: use Q_STATIC_LOGGING_CATEGORYThiago Macieira2024-09-071-1/+1
| | | | | | | | | | | | | Because the deprecation warning tells us to do so: qloggingcategory.h:168:67: warning: ‘const QLoggingCategory& qLcTsLib() [with <template-parameter-1-1> = void]’ is deprecated: Use Q_STATIC_LOGGING_CATEGORY or add either Q_DECLARE_LOGGING_CATEGORY or QT_DECLARE_EXPORTED_QT_LOGGING_CATEGORY in a header [-Wdeprecated-declarations] qtslib.cpp:20:20: note: declared here 20 | Q_LOGGING_CATEGORY(qLcTsLib, "qt.qpa.input") | ^~~~~~~~ Pick-to: 6.8 Change-Id: I2034c98d322bce24f56afffdb92821930dcf5683 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Enable mouse handling on VxWorksMichał Łoś2024-08-203-1/+171
| | | | | | | | | | | | Provide implementation of QEvdevMouseHandler for VxWorks OS. This is a preparatory change before actually using this handler, as Qt is not supporting evdev on VxWorks yet. Pick-to: 6.8 Task-number: QTBUG-115777 Change-Id: Ie92418c903a54ea1d6683e08762d4cc88c4956ac Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Make logging category staticVolker Hilsheimer2024-07-131-1/+1
| | | | | | | Silence warnings when building for Android. Change-Id: I09e3a217535ccbf28fb84e60ae12b0d7049fe7e3 Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* PlatformSupport: QDeviceDiscovery: use QDirListing directlyAhmad Samir2024-06-301-19/+11
| | | | | | | No need to construct a QDir and a QStringList. Change-Id: I25be7eab39227256e3e30e8e092a2a954b4bfab4 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Straighten out various logging categoriesUlf Hermann2024-06-1915-16/+24
| | | | | | | | | | | | Either make them static or declare them in a header. We want them to be static wherever possible, in order to reduce the number of visible symbols. If they can't be static, however, they should at least be declared in only one place. Task-number: QTBUG-67692 Change-Id: I6f3b596ed4f0adc9873dd0a5f54f055a991a6207 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Remove redundant qtimer.h includesAhmad Samir2024-06-112-2/+0
| | | | | | | | | | | | | | If QTimer isn't used in the file where it's included, remove the include. Fix files that depended on transitive includes. QMacPanGestureRecognizer: drive by change: classes inheriting from QObject should have Q_OBJECT macro in the definition. Change-Id: Ia8d71f4195a1ca643c9fcb14db41877413348d98 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* libinput: Allow setting touchscreen matrix via env varShawn Rutledge2024-04-091-0/+28
| | | | | | | | | | | | [ChangeLog][QtGui][libinput] The environment variable QT_QPA_LIBINPUT_TOUCH_MATRIX now can be set with a string of 6 space-separated numbers to set the touchscreen transformation matrix. See docs for libinput_device_config_calibration_set_matrix() Fixes: QTBUG-68698 Change-Id: I72ba94e1ee6d39d31d1689ce6ce85fa8e676ff13 Reviewed-by: Dominik Holland <dominik.holland@qt.io> Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Fix -Wimplicit-fallthrough for clangTim Blechmann2024-03-011-0/+1
| | | | | | | | | | | | | | | | | | | Clang's `-Wimplicit-fallthrough` warnings are a little stricter than gcc's interpretation: switch (i) { case 0: foo(); case 4: break; } While gcc accepts the implicit fallthrough, if the following statement is a trivial `break`, clang will warn about it. Pick-to: 6.7 Change-Id: I38e0817f1bc034fbb552aeac21de1516edcbcbb0 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Introduce NO_GENERATE_CPP_EXPORTS argument for qt_internal_add_moduleAlexey Edelev2024-02-094-0/+4
| | | | | | | | | | | The argument is inverted GENERATE_CPP_EXPORTS argument. Use it explicitly for the modules that do not require the autogenerated cpp exports. Task-number: QTBUG-90492 Change-Id: Ic67772ba9ed5e40f132a97e7d6844102ad023ff3 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Rename QWSI::handleWindowActivated to QWSI::handleFocusWindowChangedTor Arne Vestbø2023-11-231-4/+4
| | | | | | | | | | | | | | | | | | | A single QWindow is QGuiApplication::focusWindow() at a time, and this window is typically also QWindow::isActive(), but other windows may also be QWindow::isActive(). For example, we treat any sibling or ancestor of the focusWindow as being QWindow::isActive() as well. In addition, in the case of non-QWindow child windows, we may have to query the platform for the activation state, which means we also need a way for the platform to reflect changes in this state through QWSI. The current API for this, QWSI::handleWindowActivated, is in practice a focus window change API, so as a first step let's rename it to better reflect what it's doing. Task-number: QTBUG-119287 Change-Id: I381baf8505dd13a4a829c961095a8d2ed120092b Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* tslib: generate event with correct buttons and event typeSamuli Piippo2023-11-081-3/+6
| | | | | | | | | | | | Tslib doesn't give button and movements events separately, so send the first event with pressure as MouseButtonPress, subsequent events as MouseMove and event without pressure as MouseButtonRelease. Pick-to: 6.6 6.5 6.2 Fixes: QTBUG-111952 Fixes: QTBUG-113307 Change-Id: I7ed6e37936887e11affb254d2fca74c79b6a43b9 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Include what you need: <QPointer>Marc Mutz2023-10-121-0/+2
| | | | | | | | | | | | | | | | | | | | | | | All these TUs relied on transitive includes of qpointer.h, maybe to a large extent via qevent.h, though, given that qevent.h is more or less the only public QtBase header that includes qpointer.h, something else seems to be at play here. Said qevent.h actually needs QPointer in-name-only, so a forward declaration would suffice. Prepare for qevent.h dropping the include. The algorithm I used was: If the TU mentions 'passiveGrabbers', the name of the QEvent function that returns QPointers, and the TU doesn't have qpointer.h included explicitly, include it. That may produce False Positives, but better safe than sorry. Otherwise, in src/, add an include to all source and header files which mention QPointer. Exception: if foo.h of a foo.cpp already includes it, don't include again. Task-number: QTBUG-117670 Change-Id: I3321cccdb41ce0ba6d8a709cea92427aba398254 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* kms: Print the screen virtual position in the logsLaszlo Agocs2023-09-251-0/+1
| | | | | | | | | | | It is impossible to see otherwise what is going on. What's worse, it prints the screen geometry (that does not include the virtual desktop adjustment), which is incredibly confusing. Change-Id: Ie67a4d8110a0b5c9cb75e6290f06c857a980d2c8 Pick-to: 6.6 Reviewed-by: Christian Strømme <christian.stromme@qt.io>
* QEvdevTouchScreenData: use string view types moreAnton Kudryavtsev2023-09-071-4/+4
| | | | | Change-Id: I28b3a8f48bf99cc87d2fdea9a370fce62a233959 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Fix link to platform window in QAndroidPlatformBackingStore::flush()Axel Spoerl2023-08-043-11/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Android QPA implementation requires a 1:1 link between a platform window and a platform backing store, to correctly flush a backing store to the screen. QAndroidPlatformBackingStore has a bool member m_backingStoreSet, to remember if this link exists. It defaults to false and is set to true, when setBackingStore() is called in the constructor. It falsely remains true, when a platform window is deleted, e.g. because a QWindow has been hidden. When the QWindow is shown again, a new Android platform window is created. With m_backingStoreSet still being true, this new platform window will never be associated with a backing store. As a consequence, it will never be displayed on the screen. The 1:1 relationship of an Android platform window and an Android backing store is neither ideal, nor in line with other QPA layers (e.g. XCB). Changing the Android QPA implementation is complex and a short term fix is necessary. This patch removes the member m_backingStoreSet. Instead of it, QAndroidPlatformBackingStore::flush() directly checks, if the platform window corresponding to the QWindow argument is associated to a backing store. If that is not the case, setBackingStore() is called. QTBUG-97482 has been fixed with another approach, which this patch reverts. The following commits are effectively reverted by this patch: 9a39ad8dfb4e6d1a179bd0fa38026886f8f7cb8e f91588923b1e7b68f1bd79b38af44d024df85996 a4ca9e80658bca7dad1529f03c1b59173a6ecf62 dbb072eb2838a04e89e34dad686394a496d5de87 959a8b3967ac3b6315f5b458628ec5661dfc367e Fixes: QTBUG-97482 Pick-to: 6.6 6.5 6.2 Change-Id: Ic4344f8df2e954c057dd2705340f11dfd2d4c6fe Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Implement virtual void QPlatformWindow::setBackingStore()Axel Spoerl2023-07-143-2/+11
| | | | | | | | | | | | | | | | | | QWidget re-uses an existing backing store. Platform windows depend on being associated to a backing store, in case they become toplevel windows. If a platform window gets deleted and re-created each time it is shown or hidden, it has to be manually associated to the re-used backing store. This patch partly reverts fbf0aeea7d3b38ced7a16fcd5c3e2e9b45536292. It removes Android specific code from QWidgetPrivate::create(), which has been added to suppress re-using backing stores in the absence of the new API. Fixes: QTBUG-97482 Pick-to: 6.6 Change-Id: Iaa1b7652efa120ec1955914c0383e8ccd8a41429 Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
* QtGui: code tidies: use the 4-arg connect overloadGiuseppe D'Angelo2023-06-282-2/+2
| | | | | | | | The 3-arg connect is error-prone and makes the lifetime of the connection unclear. Change-Id: I99aa3575a7f901ac52f451f9ef51aa903640d097 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Div. private RAII/smart ptr classes: mark ctors [[nodiscard]]Marc Mutz2023-06-211-1/+1
| | | | | | | | | | | | | | | | The following private APIs are either RAII or smart pointer classes: - QAutoPointer - QBoolBlocker - QFdContainer QUIP-0019 says to mark RAII and smart pointer class ctors [[nodiscard]], so do that. Pick-to: 6.6 Task-number: QTBUG-104164 Change-Id: Ibc77e6603fadf18ea28428a49635f46a5680b777 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
* QXkbCommon: set Qt::KeypadModifier when keypad button is pressedMario Roessel2023-04-201-1/+1
| | | | | | | | Pick-to: 6.5 Task-number: QTBUG-111503 Done-With: Liang Qi <liang.qi@qt.io> Change-Id: Ic7ca48ea8709d38aa83c95a9b5a7d39ff82f08c7 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* src: Remove remains of qmake conversion from CMakeLists.txt filesFriedemann Kleint2023-02-105-28/+5
| | | | | | Pick-to: 6.5 Change-Id: Id644d322a602038403bb7f46c532744575fbf6d3 Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
* fbconvenience: use smart pointer for QFbCursorLiang Qi2023-02-102-2/+2
| | | | | | | Pick-to: 6.5 6.4 6.2 5.15 Fixes: QTBUG-110785 Change-Id: Id82fc300c5716ce68a2609b7fb36195f2d37e322 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Add eglfs touch logging in qt.qpa.input.eventsShawn Rutledge2022-12-161-0/+8
| | | | | | | | | We have this logging category on xcb and ios already. Task-number: QTBUG-103620 Pick-to: 6.5 Change-Id: I70153c4ea9d62316d0e05550559010d85e2f9d85 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Port from container::count() and length() to size() - V5Marc Mutz2022-11-032-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a semantic patch using ClangTidyTransformator as in qtbase/df9d882d41b741fef7c5beeddb0abe9d904443d8, but extended to handle typedefs and accesses through pointers, too: const std::string o = "object"; auto hasTypeIgnoringPointer = [](auto type) { return anyOf(hasType(type), hasType(pointsTo(type))); }; auto derivedFromAnyOfClasses = [&](ArrayRef<StringRef> classes) { auto exprOfDeclaredType = [&](auto decl) { return expr(hasTypeIgnoringPointer(hasUnqualifiedDesugaredType(recordType(hasDeclaration(decl))))).bind(o); }; return exprOfDeclaredType(cxxRecordDecl(isSameOrDerivedFrom(hasAnyName(classes)))); }; auto renameMethod = [&] (ArrayRef<StringRef> classes, StringRef from, StringRef to) { return makeRule(cxxMemberCallExpr(on(derivedFromAnyOfClasses(classes)), callee(cxxMethodDecl(hasName(from), parameterCountIs(0)))), changeTo(cat(access(o, cat(to)), "()")), cat("use '", to, "' instead of '", from, "'")); }; renameMethod(<classes>, "count", "size"); renameMethod(<classes>, "length", "size"); except that the on() matcher has been replaced by one that doesn't ignoreParens(). a.k.a qt-port-to-std-compatible-api V5 with config Scope: 'Container'. Added two NOLINTNEXTLINEs in tst_qbitarray and tst_qcontiguouscache, to avoid porting calls that explicitly test count(). Change-Id: Icfb8808c2ff4a30187e9935a51cad26987451c22 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Port from qAsConst() to std::as_const()Marc Mutz2022-10-115-6/+6
| | | | | | | | | | | | | | | | We've been requiring C++17 since Qt 6.0, and our qAsConst use finally starts to bother us (QTBUG-99313), so time to port away from it now. Since qAsConst has exactly the same semantics as std::as_const (down to rvalue treatment, constexpr'ness and noexcept'ness), there's really nothing more to it than a global search-and-replace, with manual unstaging of the actual definition and documentation in dist/, src/corelib/doc/ and src/corelib/global/. Task-number: QTBUG-99313 Change-Id: I4c7114444a325ad4e62d0fcbfd347d2bbfb21541 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>