From c0978ce798c1d85a485f74a891d18516ef3409f8 Mon Sep 17 00:00:00 2001 From: Paul Olav Tvete Date: Tue, 5 Mar 2024 12:31:12 +0100 Subject: 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 (cherry picked from commit 7a8f3b66158c9c5cd388ff5adb533259b87ab843) Reviewed-by: Qt Cherry-pick Bot --- src/compositor/compositor_api/qwaylandcompositor.cpp | 4 ++++ 1 file changed, 4 insertions(+) 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 #include #include +#include #include #include @@ -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(QGuiApplication::platformNativeInterface()->nativeResourceForIntegration("server_wl_display")); -- cgit v1.2.3