summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Olav Tvete <paul.tvete@qt.io>2024-03-05 12:31:12 +0100
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2024-03-06 16:40:07 +0000
commit99ab479a3620a0646b221e3032c8eeb8ad56affb (patch)
tree0e45be7480d922ec570dd4aa0ee307d8fac4c8ab
parent77fca1451b39e4f1693ccd7ee7f709ac9dbb4efc (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.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> (cherry picked from commit c0978ce798c1d85a485f74a891d18516ef3409f8)
-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 c8d4d80eb..3fe6f9a59 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>
@@ -137,6 +138,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"));