summaryrefslogtreecommitdiffstats
path: root/src/gui/platform/unix/qdesktopunixservices.cpp
Commit message (Collapse)AuthorAgeFilesLines
* QDesktopUnixServices: Register with host app registryDavid Redondo2025-10-101-1/+55
| | | | | | | | | | | | | | | | | | | This is useful when accessing portal APIs when not sandboxed as it allows the portal to display info which app is making the request. For example the dialog that will be shown when QScreenCapture goes through the portal can show the app name. We need to do this as it can only be set before making any call to the portal at all which are done here for color picking or by the relevant platformthemes for settings. See the paragraph at the top of https://flatpak.github.io/xdg-desktop-portal/docs/api-reference.html and https://flatpak.github.io/xdg-desktop-portal/docs/doc-org.freedesktop.host.portal.Registry.html Fixes: QTBUG-133401 Pick-to: 6.10 Change-Id: Ie55c371c6a19b3197f7798ee6233c2f19b18a6f6 Reviewed-by: David Edmundson <davidedmundson@kde.org>
* gui: Mark qdesktopunixservices.cpp as security criticalLiang Qi2025-07-221-0/+1
| | | | | | | | It tries to launch external applications like browser and etc. Pick-to: 6.10 6.9 6.8 Change-Id: I6564dc3af7c2bf76c99c2d5aa6dad2feacc94ff1 Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* QDesktopUnixServices: don't leak the QDBusPendingCallWatcherMarc Mutz2025-03-281-2/+2
| | | | | | | | | | | | | | | | | | | | | When, like in tst_QApplication::qtbug_103611(), a QApplication object is destroyed without calling exec(), then QDesktopUnixServices leaked its QDBusPendingCallWatcher, because the connection to the slot that would deleteLater() the watcher was disconnected, and the watcher had no QObject parent that would otherwise reap it. Fix by actually deleting the watcher in ~QDesktopUnixServices(), if it still exists (which implies disconnecting, of course). This makes tst_QApplication asan-clean on Linux/X11 (was: "75466 bytes leaked in 965 allocations"). Amends de609d84b9cee4a481d1718c00b09105d8c2ae69. Pick-to: 6.9 6.8 6.5 Change-Id: I28a08abdb1be65a8746702ad304282de4e1100d7 Reviewed-by: Liang Qi <liang.qi@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Add logging category for platform servicesDavid Redondo2025-02-251-9/+5
| | | | | | | Rather than being hidden behind a compile time flag or uncategorized Change-Id: I3bc1781351220441134fb9815644e905273a1e40 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* QDesktopUnixServices: Fix #endif commentDavid Redondo2025-01-301-1/+1
| | | | | | | | So it doesn't confuse me or anyone else again Pick-to: 6.9 Change-Id: I8ad5d4cb1b00e0edaffa90ed67e30246211e1a97 Reviewed-by: Liang Qi <liang.qi@qt.io>
* Platform: unix - avoid modifying the environmentTim Blechmann2025-01-291-7/+16
| | | | | | | | | | | | | | Modifying the process environment can cause crashes in application code that accesses the environment via non-qt functions on worker threads. When launching a process, we can avoid modifying the environment of the caller by using QProcess with setEnvironment. The codepaths without QProcess support is still prone to these issues and could potentially be improved via execve Task-number: QTBUG-129222 Pick-to: 6.8 6.9 Change-Id: I4e2d93abaa0e392b341041faaae0ffd11e225bcb Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* QDesktopUnixServices: avoid to call virtual function in constructorLiang Qi2025-01-231-1/+1
| | | | | | | | This amends 1969b1a90a79dad049694bd1540f8627d5f26875 . Pick-to: 6.9 6.8 6.5 Change-Id: I1be4e229d531f8a91e1ad3133a5b62784d18bb41 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* platforms: rename QGenericUnixServices to QDesktopUnixServicesLiang Qi2025-01-211-0/+639
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>