summaryrefslogtreecommitdiffstats
path: root/src/gui/platform/unix/dbusmenu
Commit message (Collapse)AuthorAgeFilesLines
* Doc: Qt Gui: Mark private APIs \internalTopi Reinio6 days1-0/+1
| | | | | | | | | | Resolves multiple QDoc warnings of type "No output generated for X::Y because X is undocumented." Pick-to: 6.11 Task-number: QTBUG-141665 Change-Id: I6a597f6979151565fcee36964f892976964be75d Reviewed-by: Topi Reinio <topi.reinio@qt.io>
* CRA review: gui/platform/unix/dbusmenu/*Liang Qi2025-09-2512-0/+12
| | | | | | | | | | | | | The files that we maintain by hand are marked as significant. D-Bus is security critical, but the Qt DBus Menu implementation is merely a user, and does not do any parsing or communication on its own. QUIP: 23 Task-number: QTBUG-134573 Pick-to: 6.10 6.8 Change-Id: I2404638024884c0daa53fa9da6252b89d596f3ee Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* dbusmenu: Skip registration with the registrar on WaylandVlad Zahorodnii2025-04-111-14/+19
| | | | | | | | | | | | | | | | | | The RegisterWindow request expects a window id. The QDBusMenuBar uses the QWindow::winId() property for that. On X11, the winId() returns the XID of the window. On Wayland, the winId() returns an integer that has meaning only to the application, there are no global window ids on Wayland. The menubar should be registered using other means, for example using the kde-appmenu protocol, which QtWayland already does. The QDBusMenuBar can skip synchronously calling the RegisterWindow request on Wayland because the menu will be registered using a different api. Pick-to: 6.9 Change-Id: I6b2968624c5c9ddbdc93807f65eac369dc7a993a Reviewed-by: David Edmundson <davidedmundson@kde.org> Reviewed-by: Liang Qi <liang.qi@qt.io>
* platforms: rename QGenericUnixServices to QDesktopUnixServicesLiang Qi2025-01-211-3/+3
| | | | | | | | | | The implementation follows XDG Desktop Portal mostly, and is for desktop, not generic unix. Task-number: QTBUG-130884 Pick-to: 6.9 Change-Id: I88456abb37b8b23cfec00ee8eac8ffee9a65ed9f Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* xcb: Report location of DBus menubar on window propertiesDavid Edmundson2024-10-102-7/+19
| | | | | | | | | | | | | | | KDE extended the DBus menubar protocol to report the DBus service and path on the window itself, this makes looking it up easier than going through a broker. On Qt5 this worked because we handled the entire DBus menu from scratch in KDE's own platformtheme, but given Qt now has direct dbusmenu bar support it makes sense to have the remaining reporting side all in one place. Change-Id: I78044992fa1840c40a66384033ed790ce0cd7f96 Task-number: QTBUG-116352 Reviewed-by: Liang Qi <liang.qi@qt.io>
* Straighten out various logging categoriesUlf Hermann2024-06-191-2/+0
| | | | | | | | | | | | 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>
* Teach QKeySequencePrivate about QKeyCombinationTor Arne Vestbø2023-10-091-7/+7
| | | | | | | | | | Being explicit about whether we're dealing with QKeyCombination or a plain Qt::Key helps understand the code. Keys are still stored as ints though. Change-Id: I2cb7bf2c5fabcecbd4dd3e99ba6240fb1910dcc7 Reviewed-by: Liang Qi <liang.qi@qt.io>
* Revert "D-Bus system tray: properly check whether StatusNotifierHost available"Ilya Fedin2023-04-052-7/+7
| | | | | | | | | | | | | | | | | This reverts commit 23e9b57e3d261f66168a8a28ccb8e5c886b4841f. The original commit was made based on a KDE workaround for libdbusmenu-qt crash, but Qt is not using libdbusmenu-qt, Qt is not watching for StatusNotifierHost registration and Qt is not capable to switch backends on the fly leading to tray support being not detected on Plasma Wayland sessions and falling back to the poor legacy protocol on X11. Task-number: QTBUG-94871 Pick-to: 6.5 Change-Id: Ic3e4a9c2d6db00299ed1f2b14043c4b675fb8ccc Reviewed-by: Dmitry Shachnev <mitya57@gmail.com> Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
* Port from container.count()/length() to size()Marc Mutz2022-10-042-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is semantic patch using ClangTidyTransformator: auto QtContainerClass = expr(hasType(namedDecl(hasAnyName(<classes>)))).bind(o) makeRule(cxxMemberCallExpr(on(QtContainerClass), callee(cxxMethodDecl(hasAnyName({"count", "length"), parameterCountIs(0))))), changeTo(cat(access(o, cat("size"), "()"))), cat("use 'size()' instead of 'count()/length()'")) a.k.a qt-port-to-std-compatible-api with config Scope: 'Container'. <classes> are: // sequential: "QByteArray", "QList", "QQueue", "QStack", "QString", "QVarLengthArray", "QVector", // associative: "QHash", "QMultiHash", "QMap", "QMultiMap", "QSet", // Qt has no QMultiSet Change-Id: Ibe8837be96e8d30d1846881ecd65180c1bc459af Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Use SPDX license identifiersLucie Gérard2022-05-1612-456/+24
| | | | | | | | | | | | | 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. Task-number: QTBUG-67283 Change-Id: Id880c92784c40f3bbde861c0d93f58151c18b9f1 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* QtGui: includemocsMarc Mutz2022-04-295-0/+10
| | | | | | | | | | | Including moc files directly into their classes' TU tends to improve codegen and enables extended compiler warnings, e.g. about unused private functions or fields. Pick-to: 6.3 6.2 5.15 Task-number: QTBUG-102886 Change-Id: I1945741794c25679a9d94c0d68c8642e2c823502 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* QtGui: use _L1 for for creating Latin-1 string literalsSona Kurazyan2022-04-284-27/+35
| | | | | | Task-number: QTBUG-98434 Change-Id: Idcb71c1d27125333a53b6bdd3e1af0d4c66617fa Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QtGui: stop using QLatin1Char constructor for creating char literalsSona Kurazyan2022-04-131-2/+2
| | | | | | | | | Required for porting away from QLatin1Char/QLatin1String in scope of QTBUG-98434. Change-Id: I308d86cefcbfd126929b68f9a853d420840c965f Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* QtGui: sweep Q_DECLARE_METATYPE → QT_DECL_METATYPE_EXTERN [2/2]: private APIMarc Mutz2022-04-052-9/+19
| | | | | | | | | | | | | It's one of our best tools to improve compile times. Can't backport to Qt 6.2 because the macros don't exist there. Pick-to: 6.3 Task-number: QTBUG-102206 Change-Id: I80734b4d43928fce0e66329b5b897a2738db9b30 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Make sure all qtbase private headers include at least one otherThiago Macieira2022-02-243-2/+5
| | | | | | | | | | See script in qtbase/util/includeprivate for the rules. Since these files are being touched anyway, I also ran the updatecopyright.pl script too. Change-Id: Ib056b47dde3341ef9a52ffff13ef677e471674b6 Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* QDBusMenuConnection: Close open D-Bus connectionJonas Kvinge2021-06-302-0/+9
| | | | | | | | | | | | | | Using QSystemTrayIcon::isSystemTrayAvailable() generates a new connection from QDBusTrayIcon::isSystemTrayAvailable() with a new unique instance ID. These were never closed, so calling QSystemTrayIcon::isSystemTrayAvailable() frequently leads to crash when it runs out of file descriptors. Fixes: QTBUG-94839 Pick-to: 5.15 6.1 6.2 Change-Id: Ib71441a6b680d8633707cc02f9b6081c0f02472b Reviewed-by: Dmitry Shachnev <mitya57@gmail.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Don't own unique name for QDBusTrayIconIlya Fedin2021-04-212-14/+5
| | | | | | | | | | | | | | | | | | Flatpak doesn't allow to own random name with PID. Even after adding such a permission into manifest, all flatpaked apps have PID 2, so only one Qt application at a time can have tray icon. Even though unique name is a part of the spec, no tray hosts really check it and SNI implementations without unique name run just fine inside and outside of Flatpak. This fixes the inability of Qt applications to have tray icon in Flatpak outside of KDE. Pick-to: 6.0 6.1 5.15 Change-Id: Ieea6dc335b7a74537a51929f6e70ca68c84228fb Reviewed-by: Dmitry Shachnev <mitya57@gmail.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Remove QtDBus includesDavid Skoland2021-01-123-22/+26
| | | | | | | | | | | | | | Per the discussion of QTBUG-88831, we determined that module-wide imports are unfortunate, especially for compile times. Following this, all QtDBus includes have been replaced with the headers for the classes actually used in each file. Additionally, some cleanup of header file order and format has been performed in the changed files. Pick-to: 6.0 Change-Id: I62c1b75682a48422f0ba1168dd5d7bd0952808ac Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Remove the qmake project filesJoerg Bornemann2021-01-071-15/+0
| | | | | | | | | | | | | | | | Remove the qmake project files for most of Qt. Leave the qmake project files for examples, because we still test those in the CI to ensure qmake does not regress. Also leave the qmake project files for utils and other minor parts that lack CMake project files. Task-number: QTBUG-88742 Change-Id: I6cdf059e6204816f617f9624f3ea9822703f73cc Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* Replace discouraged Q_MOVABLE_TYPE by Q_RELOCATABLE_TYPEAndreas Buhr2020-11-301-4/+4
| | | | | | | | | | | | | | Q_MOVABLE_TYPE was conceived before C++ had move semantics. Now, with move semantics, its name is misleading. Q_RELOCATABLE_TYPE was introduced as a synonym to Q_MOVABLE_TYPE. Usage of Q_MOVABLE_TYPE is discouraged now. This patch replaces all usages of Q_MOVABLE_TYPE by Q_RELOCATABLE_TYPE in QtBase. As the two are synonymous, this patch should have no impact on users. Pick-to: 6.0 Change-Id: Ie653984363198c1aeb1f70f8e0fa189aae38eb5c Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
* Long live QKeyCombination!Giuseppe D'Angelo2020-09-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | C++20 via P1120 is deprecating arithmetic operations between unrelated enumeration types, and GCC 10 is already complaining. Hence, these operations might become illegal in C++23 or C++26 at the latest. A case of this that affects Qt is in key combinations: a QKeySequence can be constructed by summing / ORing modifiers and a key, for instance: Qt::CTRL + Qt::Key_A Qt::SHIFT | Qt::CTRL | Qt::Key_G (recommended, see below) The problem is that the modifiers and the key belong to different enumerations (and there's 2 enumerations for the modifier, and one for the key). To solve this: add a dedicated class to represent a combination of keys, and operators between those enumerations to build instances of this class. I would've simply defined operator|, but again docs and pre-existing code use operator+ as well, so added both to at least tackle simple cases (modifier + key). Multiple modifiers create a problem: operator+ between them yields int, not the corresponding flags type (because operator+ is not overloaded for this use case): Qt::CTRL + Qt::SHIFT + Qt::Key_A \__________________/ / int / \______________/ int Not only this loses track of the datatypes involved, but it would also then "add" the key (with NO warnings, now its int + enum, so it's not mixing enums!) and yielding int again. I don't want to special-case this; the point of the class is that int is the wrong datatype. Everything works just fine when using operator| instead: Qt::CTRL | Qt::SHIFT | Qt::Key_A \__________________/ / Qt::Modifiers / \______________/ QKeyCombination So I'm defining operator+ so that the simple cases still work, but also deprecating it. Port some code around Qt to the new class. In certain cases, it's a huge win for clarity. In some others, I've just added the necessary casts to make it still compile without warnings, without attempting refactorings. [ChangeLog][QtCore][QKeyCombination] New class to represent a combination of a key and zero or more modifiers, to be used when defining shortcuts or similar. [ChangeLog][Potentially Source-Incompatible Changes] A keyboard modifier (such as Qt::CTRL, Qt::AltModifier, etc.) should be combined with a key (such as Qt::Key_A, Qt::Key_F1, etc.) by using operator|, not operator+. The result is now an object of type QKeyCombination, that stores the key and the modifiers. Change-Id: I657a3a328232f059023fff69c5031ee31cc91dd6 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Use QList instead of QVector in gui implementationJarek Kobus2020-07-071-6/+6
| | | | | | | Task-number: QTBUG-84469 Change-Id: I366e845249203d80d640355a7780ac2f91a762f1 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Add ; to Q_UNUSEDLars Schmertmann2020-07-072-4/+4
| | | | | | | | This is required to remove the ; from the macro with Qt 6. Task-number: QTBUG-82978 Change-Id: I3f0b6717956ca8fa486bed9817b89dfa19f5e0e1 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Move linuxaccessibility to QtGuiFriedemann Kleint2020-07-061-3/+3
| | | | | | | | Change some too-generic file names. Task-number: QTBUG-83255 Change-Id: I4497ee2508bc323566f4061d4547707b7bda7a77 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Move UNIX themes into QtGuiFriedemann Kleint2020-06-2213-0/+2019
Task-number: QTBUG-83255 Change-Id: I9e3aecd8e172b60121f472c840eaf2a5538af438 Reviewed-by: Liang Qi <liang.qi@qt.io>