summaryrefslogtreecommitdiffstats
path: root/src/window-lib
Commit message (Collapse)AuthorAgeFilesLines
* ASAN, qmllint and compiler warning fixesRobert Griebl13 days1-5/+2
| | | | | Change-Id: I6ee4c7d92adb19de26d7076eeb52d134650188ab Reviewed-by: Dominik Holland <dominik.holland@qt.io>
* A better watchdog for Wayland, main thread and scene graphRobert Griebl13 days10-94/+349
| | | | | | | | | | | | | | | | | | | | | | | This replaces the existing Wayland ping/pong watchdog with a new setup that monitors: - Wayland XDG clients (on a per-client basis, not per-surface as before) - The main event loop - All scene-graph render threads, split up into the states: syncing, rendering and swapping. Each of those sub-watchdogs has a configurable check interval, a warn timeout and a kill timeout. In addition, this watchdog can also handle watchdog request coming from systemd, if the AM is started via a systemd unit with the relevant options enabled. The documentation will come in a follow-up commit. Fixes: QTBUG-125986 Change-Id: I3d50a0d33625c180965eed98b24c80dc7cf9dece Reviewed-by: Dominik Holland <dominik.holland@qt.io>
* Warn users about wrongly instantiating QML typesRobert Griebl2024-05-232-2/+10
| | | | | | | | | | | | | Technically we cannot hide SystemUI types in an Application context and vice versa in single-process mode. To make matters worse, we also cannot reasonably check each invocation of a function or property accessor for singletons. But we CAN at least make sure that the instantiatable types are not instantiated in the wrong context. Change-Id: I44ea14f59578f1b3e5230ccfb52e0358896d3d37 Reviewed-by: Dominik Holland <dominik.holland@qt.io>
* Remove our #pragma once workaround, as it is not needed anymoreRobert Griebl2024-05-151-3/+0
| | | | | | Change-Id: Ic8c6e2fe8aa97d7b04b02579b68c368b0115adaf Pick-to: 6.7 Reviewed-by: Dominik Holland <dominik.holland@qt.io>
* Refactor the ApplicationInterface root context propertyRobert Griebl2024-05-141-1/+1
| | | | | | | | | | | | | | | | In order to support full QML tooling, the root context property had to go. It is now replaced by a QML attached type of the same name, which for all intents and purposes acts exactly like the old root context property. There's a big difference implementation wise though: we can now have multiple ApplicationInterface objects, but their internal ApplicationInterfaceImpl objects point to the actual per-application data. Fixes: QTBUG-118426 Change-Id: I784eec946ab26e50df1d76364f5dc842bc1b3bed Reviewed-by: Dominik Holland <dominik.holland@qt.io>
* Replace all signals/slots keywords with Q_SIGNALS/Q_SLOTSRobert Griebl2024-04-227-13/+13
| | | | | Change-Id: I92238b01155a2e43b8877576faf603957dcb95ba Reviewed-by: Bernd Weimer <bernd.weimer@qt.io>
* Also support CBOR as a wire format for window properties on WaylandRobert Griebl2024-03-182-12/+38
| | | | | | | | | Our extension now supports both the old style serialization via QDataStream for Qt clients (version 1) and via CBOR for easy use in non-Qt clients (version 2). Change-Id: I757fda61af126fb273264133552b86f3e0127a6a Reviewed-by: Bernd Weimer <bernd.weimer@qt.io>
* QVariants from QML often have QJSValues, which cannot be serializedRobert Griebl2024-03-182-3/+8
| | | | | | | | | | | | | Using anything more complex than a plain string or int for window properties stopped working with Qt 6, as those QJSValues cannot be serialized via QDataStream << anymore. Most QJSValues inside QVariant however can easily be converted to C++ datatypes inside QVariant, so we do that. Change-Id: Iacbc4331d1b5dee514b421db274288df7224f902 Pick-to: 6.7 6.6 6.5 Reviewed-by: Bernd Weimer <bernd.weimer@qt.io>
* Replace all #pragma once with old-style #ifdef include guardsRobert Griebl2024-03-059-9/+36
| | | | | | | | Change-Id: I1805fbccf4d9398fddfe8f4ab977236afc49ca45 Fixes: QTBUG-122951 Pick-to: 6.7 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Dominik Holland <dominik.holland@qt.io>
* Axivion: fix or document most of the reported issuesRobert Griebl2024-02-212-5/+6
| | | | | | | Change-Id: I5723096b8db71c216b33e189a2469b3130c19504 Pick-to: 6.7 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Dominik Holland <dominik.holland@qt.io>
* Clazy: fixesRobert Griebl2024-01-087-28/+31
| | | | | | Change-Id: I2f9f0245e1d0ac0c6ee618a0c90f31aaa1465e93 Pick-to: 6.7 Reviewed-by: Dominik Holland <dominik.holland@qt.io>
* Modernize string literalsRobert Griebl2024-01-084-10/+17
| | | | | | | | | Replace all our custom qSL/qL1S/qL1C macros with standard C++ and QString unicode string literals. Change-Id: I9e0b69fb46525421f408f260518a69b8f8125d99 Pick-to: 6.7 Reviewed-by: Dominik Holland <dominik.holland@qt.io>
* Remove obsolete QT_VERSION_CHECKsRobert Griebl2023-12-222-12/+0
| | | | | | Change-Id: Ib5a13476a0819b789326651aa3425a4ffebe93b1 Pick-to: 6.7 Reviewed-by: Bernd Weimer <bernd.weimer@qt.io>
* cmake: add AM_SANITIZE to enable ASANRobert Griebl2023-12-121-0/+1
| | | | | | | | | Also added env var forwarding for [ALT]SAN_OPTIONS in NativeRuntime and fixed a few simple memory leaks. Pick-to: 6.7 6.6 6.5 Change-Id: I4039890bb9316d3a48a447f112b129b5272f81c0 Reviewed-by: Dominik Holland <dominik.holland@qt.io>
* Resolve old TODOsRobert Griebl2023-12-071-1/+1
| | | | | Change-Id: I393638635605bc00fc3eae9b44bca6a157e15f4e Reviewed-by: Bernd Weimer <bernd.weimer@qt.io>
* Replace AM_.. defines with checks for Qt features where possibleRobert Griebl2023-12-0610-38/+38
| | | | | | | Also got rid of hard to read double negated checks (!disabled) Change-Id: I93b0665ccdf60e30a473692167fde5c6d719dfa9 Reviewed-by: Dominik Holland <dominik.holland@qt.io>
* Simplify builing a custom appman executableRobert Griebl2023-12-061-4/+4
| | | | | | | | | | | | | | | | - fixed our cmake library dependencies in regards to private/public - the bwrap plugin should not depend on any AppMan module besides the plugin interface one - the special QML modules are now implicit dependencies of main-lib and application-main-lib respectively, which makes it possible to move the ugly AM_QML_REGISTER_TYPES mechanism out of the appman and launcher executables and into those libraries. - also fixed the iOS build, where we cannot use Security-Framework due to missing functionality, but the fallback to (a non existing) openssl doesn't make sense either. Change-Id: Iced023be98eed3416654a0645f0aa4ed58d10e48 Reviewed-by: Dominik Holland <dominik.holland@qt.io>
* Make FrameTimer work againRobert Griebl2023-12-052-39/+35
| | | | | | | | | This got broken in the big declarative registration patch. In addition this gets rid of the unnecessary unique connections that don't work in conjunction with lambdas. Change-Id: I5d7cbc684da544aaf08380a5cf7583e036fa2be6 Reviewed-by: Dominik Holland <dominik.holland@qt.io>
* Fix all outstanding namespace issuesRobert Griebl2023-11-204-21/+17
| | | | | | | | | | Also replaced the old QT_PREPEND_NAMESPACE_AM macro with the real namespace (QtAM::), as this makes the code easier to read for humans and also for tools like qdbuscpp2xml. The macro is still available, to support old custom appman code. Change-Id: Ifb379f03c1aacbd12ef799beb43013bba029e514 Reviewed-by: Bernd Weimer <bernd.weimer@qt.io>
* Switch to declarative registrationRobert Griebl2023-11-084-19/+0
| | | | | | | | | | | | | | | | | | | | | | After reworking all the sys-ui/app shared classes, we can now finally switch to declarative registration. As each QML namespace can only have one qt_internal_add_qml_module assigned, we need a dedicated lib/module for each of our namespaces. Due to this problem and in order to keep the code clean, all declarative registrations are kept out of the actual classes (as these are spread over multiple static libs). Instead they are all done in one place (src/qml/../) using the "foreign" syntax. The internal AmTest class (only used for the QML auto tests) had to be moved to a new QtApplicationManager.Test namespace, because adding an imperative registration to a declaratively registered namespace hides all the existing classes. Change-Id: I2e5b782da33a470a6d267cf45b42866fe6a9c14e Task-number: QTBUG-103266 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Dominik Holland <dominik.holland@qt.io>
* Add an auto-test for window focus/activation handlingRobert Griebl2023-11-082-0/+19
| | | | | | | | | | Also added a getter for the actual "adapter" Quick item on the sys-ui side (backingItem), as it is needed for this test. It might come in handy for user projects as well, especially to get direct access to the QWaylandQuickItem. Change-Id: I9665ca31566e98bae086b8cdc1aa2df5cab4023e Reviewed-by: Bernd Weimer <bernd.weimer@qt.io>
* Improve Wayland WindowItem de-activationRobert Griebl2023-11-062-3/+25
| | | | | | | | Wayland window de-activation doesn't work automatically in case the sys-ui gets focus, so we have to force that. Change-Id: I57b6ec039cd15a6c2cb2d3c973628c5ee6975526 Reviewed-by: Bernd Weimer <bernd.weimer@qt.io>
* Add focusOnClick for both Wayland and InProcess windowsRobert Griebl2023-11-062-3/+60
| | | | | Change-Id: I80ba80c1f822e4486adb321c83c7b085e27caf48 Reviewed-by: Bernd Weimer <bernd.weimer@qt.io>
* Add an ApplicationManagerWindow attached objectRobert Griebl2023-11-061-0/+4
| | | | | | | | | | | | | | | | This makes it easier to always reach your AMW instance, especially now in multi-process mode, where Window.window will NOT be the AMW anymore. The attached object is modelled after the Window attached one, so activeFocusItem was added to both AMW and AMWAttached. Also fixed the most obvious of the non-implemented in-process AMW properties. This needs a follow-up commit to completely fix that though. Change-Id: Icac9bfb2994ca6250f0056e142bd59c8ef4b469a Task-number: QTBUG-103266 Reviewed-by: Bernd Weimer <bernd.weimer@qt.io>
* Fix adding wayland extensionsBernd Weimer2023-10-091-1/+1
| | | | | | | | | | Wayland extension objects should be created within their component context to allow "ComponentBehavior: Bound", which will be the default in the future. Change-Id: Ib229c9a9c0fd006c88d939140ad364bd902f1978 Pick-to: 6.6 6.5 Reviewed-by: Robert Griebl <robert.griebl@qt.io>
* DBus cleanup, part 2 and shared QML APIRobert Griebl2023-09-265-25/+116
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rewrote the NativeRuntime <-> Launcher communication using auto- generated interfaces and adaptors. Also made the shared QML classes (Notification and ApplicationInterface) simple QObjects, so the QMetaObject is always the same: both on the AM and the launcher side. This is necessary for qmlsc, as the compiler doesn't know how to deal with different MOC data for the same class name in different processes. Along the same lines, ApplicationManagerWindow is now a QObject, both for in-process (this was already the case) and out-of process use. The out-of-process/Wayland implementation will now implicitly allocate a QQuickWindow and re-parent it accordingly to have the same visibility behavior as if you would be using normal Windows. Also FrameTimer got an Impl backend, although in this case a special implementation is only needed for the System-UI. And additional unrelated change was rolled into this: launcher-lib was renamed to application-main-lib and the class LauncherMain to ApplicationMain to better reflect their purpose (the lib started as the basis for launcher-qml, but evolved into a generic app/launcher helper) The reason for including these changes here is that we are touching all the files in there anyway and having a rename after these big changes would make git blame far less useful. Change-Id: Iff915c1b2209f8104051dc131b9add5498df277c Task-number: QTBUG-103266 Reviewed-by: Dominik Holland <dominik.holland@qt.io>
* QML can now deal with QList<object derived type *> propertiesRobert Griebl2023-09-262-3/+3
| | | | | | | | | | This means we can finally make our QML API look nicer. Also extended the simple QML auto-test to make sure the changed API gets tested. Change-Id: I4ce3d7d49b2cf93ed1959bd2c1c835bd3e4ce0dc Reviewed-by: Dominik Holland <dominik.holland@qt.io>
* Fix the PackageManager's package role not being usable in strict modeRobert Griebl2023-08-221-1/+10
| | | | | | | | | | | | | | | JS reserves the name "package" in strict mode for future extensions, so you cannot declare a variable or property with this name, effectively breaking access to the package role via a required property. This patch adds a "packageObject" alias role. It also adds similar roles to ApplicationManager, WindowManager and IntentServer to keep the model API as similar as possible between the four classes. Change-Id: Ib9a07cc1107d27c2844367a09a49e6b8c88faf84 Task-number: QTBUG-115998 Pick-to: 6.6 Reviewed-by: Dominik Holland <dominik.holland@qt.io>
* cmake: add support for Unity buildsRobert Griebl2023-08-161-10/+8
| | | | | | Pick-to: 6.5 6.6 Change-Id: I5304ef97f051844a26e7e277a34e4bc790543647 Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
* Clang-Tidy / Clazy warnings and modernizationRobert Griebl2023-08-014-3/+3
| | | | | Change-Id: Iafd5fbd3636068caa36f11e121233c5732f7a545 Reviewed-by: Bernd Weimer <bernd.weimer@qt.io>
* Documentation: fix link targets inside of tablesRobert Griebl2023-07-141-2/+2
| | | | | | | | | | A \target directly after a \row is generated as a <span> within a <tr>. This is invalid HTML, so these link targets are relocated to the start of the table by both Chrome and Firefox. Pick-to: 6.5 6.6 Change-Id: I2720ca7e9c2e27c22bd0376c8e0ce6835750e2b5 Reviewed-by: Bernd Weimer <bernd.weimer@qt.io>
* Mark properties exposed to QML as FINAL to prevent shadowingRobert Griebl2023-06-224-14/+14
| | | | | | | Change-Id: Iea724f9dce6358b628e0d73e44351a988a6a726d Fixes: QTBUG-114750 Pick-to: 6.6 Reviewed-by: Bernd Weimer <bernd.weimer@qt.io>
* Hide internal signals and slots from QMLRobert Griebl2023-06-212-17/+14
| | | | | | | | | | | | | We introduced the internal signaller objects a long time ago, but somehow missed to move a few internal signals out of the public API. This patch also removes left-over, dead API (the old interface extension mechanism and the old compositor registration) Change-Id: I481c382397eb8eb56d1863a5acacc95a4282c1df Fixes: QTBUG-114724 Pick-to: 6.6 Reviewed-by: Bernd Weimer <bernd.weimer@qt.io>
* Make all example and doc QML imports versionlessRobert Griebl2023-06-172-4/+4
| | | | | | Pick-to: 6.6 Change-Id: Ie3292ac14ce07c5eda08fc7869c21a788eddd1c8 Reviewed-by: Dominik Holland <dominik.holland@qt.io>
* Cleanup the D-Bus interfacesRobert Griebl2023-02-151-4/+4
| | | | | | | | | | - most of the newer PackageManager signals were not exposed at all - some properties were not exposed consistently or used the wrong type - clarified the D-Bus policy settings in regards to properties Change-Id: I6875c0a0613a0a63af2386d311a1a6c7c0031b7b Pick-to: 6.5 Reviewed-by: Dominik Holland <dominik.holland@qt.io>
* Re-enable dbus xml generation from sourceRobert Griebl2023-02-151-0/+5
| | | | | | | | | | | Somehow qdbuscpp2xml is unable to cope with QT_PREPEND_NAMESPACE_AM in Qt6, so we need to detect it and work around the issue. Long-term the tool needs a Q_DBUSCPP2XML_RUN define, to make the identification of this pre-compiler more robust. Pick-to: 6.5 Change-Id: I88fd50669e7e5c9942fbc96c02aa452cda5171c8 Reviewed-by: Dominik Holland <dominik.holland@qt.io>
* Port from qAsConst to std::as_constMarc Mutz2023-01-141-1/+1
| | | | | | | | QT_NO_AS_CONST is now globally enabled in qtbase. Pick-to: 6.5 Change-Id: Ifc2eab1c902e75f5dbfc38ef9a62b29b5c91bc61 Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* Fix include style to what's mandated for public headersAlexandru Croitor2022-12-126-17/+17
| | | | | | | | | | This fixes errors for the developer-build. Task-number: QTBUG-109337 Change-Id: I145e5eb5074f6e8b03e3304f58f0dd57ee1dfe95 Reviewed-by: Zoltan Gera <zoltan.gera@qt.io> Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> Reviewed-by: Robert Griebl <robert.griebl@qt.io>
* Adjust module to work with syncqt.cppAlexey Edelev2022-12-081-0/+4
| | | | | | | | | Add interface dependencies to fix top-level builds. Add PRIVATE_HEADER_FILTERS for the generated wayland code. Task-number: QTBUG-87480 Change-Id: I6f35777786bf4356cd8cd2c31709601a08407912 Reviewed-by: Robert Griebl <robert.griebl@qt.io>
* Forward keyboard focus to applicationsBernd Weimer2022-12-012-7/+46
| | | | | | | | | | | | | | | | | Key events were not passed to applications, when the focus moved to a WindowItem in the System UI, since the item representing the application window is actually a child of the WindowItem. A possible solution would be to explicitly send the key events to the application item, though the approach taken here is to forward the keyboard focus. This results in key events always reaching the application first (even when the System UI would actually consume the events) and in single-process mode, if the application consumes the event the System UI won't get it any more. Fixes: QTBUG-108837 Change-Id: I1699556f1a67057e8be2848e37c846c2ee33a646 Reviewed-by: Robert Griebl <robert.griebl@qt.io>
* Prevent linking of AppMan modules into user pluginsRobert Griebl2022-06-301-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | As the AppMan modules are static libraries, linking any of them into a QML plugin (that later gets loaded into the system-ui) will lead to a bunch of problems: 1) due to symbol duplication and duplicate static data, a lot of singletons may exist twice 2) all static constructors (logging, crash-handling, etc.) are run a second time, overriding any custom configuration that was applied after config parsing. If you are legitimately building a custom appman binary, a custom launcher or a native app using launcher-lib, you need to flag this via compile-time defines now: Either AM_COMPILING_APPMAN or AM_COMPILING_LAUNCHER AM_COMPILING_LAUNCHER is also used for native apps using launcher-lib. Change-Id: I0c1a3fb7e0c7121f92d44c764c2c1eeb720e7041 Pick-to: 6.4 Reviewed-by: Dominik Holland <dominik.holland@qt.io>
* Fix QScopedPointer::take deprecation warningRobert Griebl2022-06-151-1/+0
| | | | | | | | Also replaced the remaining usages of QScopedPointer with std::unique_ptr for consistency. Change-Id: Ic63d1b3ea03a4562e4e40c3e9c7992459fde716e Reviewed-by: Dominik Holland <dominik.holland@qt.io>
* Use SPDX license identifiersDominik Holland2022-06-1515-452/+62
| | | | | | | | | | | | Replace the current license disclaimer in files by a SPDX-License-Identifier. Files that have to be modified by hand are modified. License files are organized under LICENSES directory. Pick-to: 6.4 Task-number: QTBUG-67283 Change-Id: I09660e42dea769d720ff30e652485d9861cea965 Reviewed-by: Robert Griebl <robert.griebl@qt.io>
* Make both supported Wayland text-input protocols available for clientsRobert Griebl2022-06-142-3/+13
| | | | | | | | | | Qt's own protocol is the more stable option, and chosen automatically by QtVirtualKeyboard if it is made available by the compositor. Change-Id: Ic8c65e81acd2e461bf078bec26794019e0aa855c Task-number: QTBUG-103580 Pick-to: 6.3 6.4 Reviewed-by: Dominik Holland <dominik.holland@qt.io>
* Make setting window properties less chatty in verbose modeRobert Griebl2022-05-171-2/+2
| | | | | | | | | If you want low-level details, you need enable the am.wayland.debug explicitly, just running --verbose will not enable it anymore Change-Id: Ie209a5c670c3805d3dc96c1a27b67d8dfd8f3b37 Reviewed-by: Dominik Holland <dominik.holland@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Add a new flag to allow surfaces from unknown Wayland clientsRobert Griebl2022-03-233-2/+15
| | | | | | | | | | Before, this was only possible by running with the "noSecurity" flag, which disabled all security checks completely. Change-Id: I06fbd1cca414be518a19b2250b28e114687e7f93 Fixes: QTBUG-101703 Pick-to: 5.15 Reviewed-by: Bernd Weimer <bernd.weimer@qt.io>
* Fix memory leaks introduced by adding the PackageInfo mechanismRobert Griebl2022-03-212-0/+14
| | | | | | | | Found by the Linux/gcc/ASAN leak checker. Change-Id: I3c85515b994ad21b8718349baa81f9fc52a20615 Pick-to: 6.3 6.3.0 6.2 6.2.4 5.15 Reviewed-by: Bernd Weimer <bernd.weimer@qt.io>
* Remove the touch emulation featureRobert Griebl2022-03-176-541/+0
| | | | | | | | | This feature was implemented before Qt's pointer handlers were introduced and thanks to those it really isn't needed nowadays. Plus, it was only ever working on X11, limiting its usefulness. Change-Id: Icb03e2e8ede4fc5b62564fc70c20a460fe2d0134 Reviewed-by: Dominik Holland <dominik.holland@qt.io>
* Create extra sockets only just before the Wayland compositor is createdRobert Griebl2022-03-022-2/+17
| | | | | | | | | | Otherwise there will be a window where the socket already exists in file system, but is not adopted by the compositor yet, leading to "connection refused" errors should a client try to connect. Change-Id: Ic96c51c7e8175ab5e9ac40fc70b5f8dc97c11b71 Pick-to: 5.15 Reviewed-by: Dominik Holland <dominik.holland@qt.io>
* Clarify documentation and warning messagesRobert Griebl2022-02-251-1/+4
| | | | | Change-Id: If168ce2285636b2b062d8cbe5d7bc9390359b3df Reviewed-by: Dominik Holland <dominik.holland@qt.io>