Skip to content

Commit

Permalink
x11/plasma5-plasma-workspace: Make sure XDG_RUNTIME_DIR is set in sta…
Browse files Browse the repository at this point in the history
…rtplasma

Whilst X11 can get away without this, it's not ideal as the XDG spec
requires applications to warn if they have to fall back on a default,
and Wayland is built around it being set, since WAYLAND_DISPLAY is
relative to it. Whilst these days WAYLAND_DISPLAY can be an absolute
path, libwayland, and the libwayland-derived helpers used by
startplasma, don't let you do anything but create a relative socket, and
older clients won't understand it as it wasn't in the early versions.
Thus, define the variable here if it's not set rather than treading
further off the beaten path.

Note that, as far as I can tell, a full SDDM + ConsoleKit setup won't
get the variable defined, only an SDDM + (e)logind one, so I don't think
this is a problem specific to our cut-down environment but instead one
that also affects FreeBSD. Running with ck-launch-session, as you'd
normally do on the command line in order to be able to open devices
associated with your current seat, would set it though.
  • Loading branch information
jrtc27 authored and kwitaszczyk committed Nov 23, 2022
1 parent 8afb0a6 commit 9ee16a2
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions x11/plasma5-plasma-workspace/files/cheribsd.patch
Expand Up @@ -64,3 +64,20 @@ diff -ru shell/main.cpp shell/main.cpp
// Plasma scales itself to font DPI
// on X, where we don't have compositor scaling, this generally works fine.
// also there are bugs on older Qt, especially when it comes to fractional scaling
--- startkde/startplasma.cpp.orig 2022-07-11 12:02:54.000000000 +0100
+++ startkde/startplasma.cpp 2022-11-17 21:33:33.271277000 +0000
@@ -363,6 +363,14 @@
const auto extraConfigDir = QStandardPaths::writableLocation(QStandardPaths::GenericConfigLocation).toUtf8() + "/kdedefaults";
QDir().mkpath(QString::fromUtf8(extraConfigDir));
qputenv("XDG_CONFIG_DIRS", extraConfigDir + ":" + currentConfigDirs);
+
+ // Wayland sockets live in XDG_RUNTIME_DIR so make sure it's set. Other
+ // uses, including X applications, should have fallbacks, but can still
+ // benefit from it, and Qt will warn when it's not set.
+ if (!qEnvironmentVariableIsSet("XDG_RUNTIME_DIR")) {
+ const auto runtimeDir = QStandardPaths::writableLocation(QStandardPaths::RuntimeLocation).toUtf8();
+ qputenv("XDG_RUNTIME_DIR", runtimeDir);
+ }

const KConfig globals;
const QString currentLnf = KConfigGroup(&globals, QStringLiteral("KDE")).readEntry("LookAndFeelPackage", QStringLiteral("org.kde.breeze.desktop"));

0 comments on commit 9ee16a2

Please sign in to comment.