summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Olav Tvete <paul.tvete@qt.io>2024-03-05 12:31:12 +0100
committerPaul Olav Tvete <paul.tvete@qt.io>2024-03-06 09:18:00 +0100
commit7a8f3b66158c9c5cd388ff5adb533259b87ab843 (patch)
tree4eaf260abf733eeb913c073a3024c27c462a8b86
parent5fd280c671c30b2d5832326841ca6eb4806b9f0f (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.7 6.6 6.5 Change-Id: Ia2365f08ba75be276ca7cc5520875c08cc82b465 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
-rw-r--r--src/compositor/compositor_api/qwaylandcompositor.cpp4
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"));