Commit 8475fe45 authored by David Edmundson's avatar David Edmundson Committed by David Edmundson
Browse files

Only spawn dbus-run-session if there isn't a session already

Typically on modern systems this will be started for us earlier in the
startup series and we don't have to worry about it.

For X11 clients look for the bus address on the X11 root window as a way
of sharing.

For reasons at the time we start our own DBus session within our wayland
session. Nesting causes conflicts and problems so this patch only start
a dbus session if one has not been set up already.

BUG: 404335
parent 93cb711f
[Desktop Entry] [Desktop Entry]
Exec=dbus-run-session @CMAKE_INSTALL_FULL_LIBEXECDIR@/startplasma-dev.sh -wayland Exec=@CMAKE_INSTALL_FULL_LIBEXECDIR@/plasma-dbus-run-session-if-needed @CMAKE_INSTALL_FULL_LIBEXECDIR@/startplasma-dev.sh -wayland
DesktopNames=KDE DesktopNames=KDE
Name=Plasma (Development, Wayland ${CMAKE_INSTALL_FULL_BINDIR}) Name=Plasma (Development, Wayland ${CMAKE_INSTALL_FULL_BINDIR})
Name[ast]=Plasma (Desendolcu, Wayland ${CMAKE_INSTALL_FULL_BINDIR}) Name[ast]=Plasma (Desendolcu, Wayland ${CMAKE_INSTALL_FULL_BINDIR})
......
[Desktop Entry] [Desktop Entry]
Exec=dbus-run-session ${CMAKE_INSTALL_FULL_BINDIR}/startplasma-wayland Exec=@CMAKE_INSTALL_FULL_LIBEXECDIR@/plasma-dbus-run-session-if-needed ${CMAKE_INSTALL_FULL_BINDIR}/startplasma-wayland
TryExec=${CMAKE_INSTALL_FULL_BINDIR}/startplasma-wayland TryExec=${CMAKE_INSTALL_FULL_BINDIR}/startplasma-wayland
DesktopNames=KDE DesktopNames=KDE
Name=Plasma (Wayland) Name=Plasma (Wayland)
......
...@@ -39,6 +39,7 @@ install(TARGETS startplasma-x11 ${KDE_INSTALL_TARGETS_DEFAULT_ARGS}) ...@@ -39,6 +39,7 @@ install(TARGETS startplasma-x11 ${KDE_INSTALL_TARGETS_DEFAULT_ARGS})
install(TARGETS startplasma-wayland ${KDE_INSTALL_TARGETS_DEFAULT_ARGS}) install(TARGETS startplasma-wayland ${KDE_INSTALL_TARGETS_DEFAULT_ARGS})
install(TARGETS startplasma-waylandsession DESTINATION ${KDE_INSTALL_LIBEXECDIR}) install(TARGETS startplasma-waylandsession DESTINATION ${KDE_INSTALL_LIBEXECDIR})
install(PROGRAMS plasma-sourceenv.sh DESTINATION ${KDE_INSTALL_LIBEXECDIR}) install(PROGRAMS plasma-sourceenv.sh DESTINATION ${KDE_INSTALL_LIBEXECDIR})
install(PROGRAMS plasma-dbus-run-session-if-needed DESTINATION ${KDE_INSTALL_LIBEXECDIR})
if (CMAKE_SYSTEM_NAME STREQUAL "Linux") if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
install(TARGETS kde-systemd-start-condition DESTINATION ${KDE_INSTALL_BINDIR}) install(TARGETS kde-systemd-start-condition DESTINATION ${KDE_INSTALL_BINDIR})
endif () endif ()
#!/bin/sh
# Usage: plasma-dbus-run-session-if-needed PROGRAM [ARGUMENTS]
# If the session bus is not available it is spawned and wrapper round our program
# Otherwise we spawn our program directly
drs=
if [ -z "${DBUS_SESSION_BUS_ADDRESS}" ]
then
drs=dbus-run-session
fi
exec ${drs} "$@"
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment