diff options
author | Paul Olav Tvete <paul.tvete@qt.io> | 2024-03-05 12:31:12 +0100 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2024-03-06 09:23:34 +0000 |
commit | c0978ce798c1d85a485f74a891d18516ef3409f8 (patch) | |
tree | 7acf134afb881b6adab6edafc72e5db669087793 | |
parent | af1b3d32af4a3b14611a680beb759dbffc7ae94f (diff) |
Make sure XDG_RUNTIME_DIR is created
Before Qt 6.5, QGuiApplication would create XDG_RUNTIME_DIR as a
side effect of looking up QStandardPaths::writableLocation during
platform theme initialization. Since QtWaylandCompositor cannot function
without a writable XDG_RUNTIME_DIR, do that lookup when the compositor
is constructed.
Fixes: QTBUG-122965
Pick-to: 6.6 6.5
Change-Id: Ia2365f08ba75be276ca7cc5520875c08cc82b465
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
(cherry picked from commit 7a8f3b66158c9c5cd388ff5adb533259b87ab843)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r-- | src/compositor/compositor_api/qwaylandcompositor.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/compositor/compositor_api/qwaylandcompositor.cpp b/src/compositor/compositor_api/qwaylandcompositor.cpp index ea7c4a345..e6f5955b8 100644 --- a/src/compositor/compositor_api/qwaylandcompositor.cpp +++ b/src/compositor/compositor_api/qwaylandcompositor.cpp @@ -41,6 +41,7 @@ #include <QtCore/QCoreApplication> #include <QtCore/QStringList> #include <QtCore/QSocketNotifier> +#include <QStandardPaths> #include <QtGui/QDesktopServices> #include <QtGui/QScreen> @@ -135,6 +136,9 @@ public: QWaylandCompositorPrivate::QWaylandCompositorPrivate(QWaylandCompositor *compositor) { + // Create XDG_RUNTIME_DIR, if it does not already exist + QStandardPaths::writableLocation(QStandardPaths::RuntimeLocation); + if (QGuiApplication::platformNativeInterface()) display = static_cast<wl_display*>(QGuiApplication::platformNativeInterface()->nativeResourceForIntegration("server_wl_display")); |