Currently, all the Menus that allow one to leave KDE (logout, lock screen, poweroff, …) always assume a local session, even when running as a remote session under x2go, xrdp, etc. However, when running remote the actions available don't fit the use case and should be in most cases limited to logging out and suspending the session. (Most are useless when regular users don't even have the permissions for things like power controls) The lock screen could be argued over, I'm in favor of suspending the session and completely closing the connection in order to lock it. The Mate Desktop solved this problem by using librda to detect how the desktop was started, which actions are available and calling the appropriate handlers. librda: https://github.com/ArcticaProject/librda Corresponding blog post: https://sunweavers.net/blog/node/82 Context: Librda detects remote sessions based on Environment variables and the logout/suspend functions call the appropriate commands. This is a resubmitted version of Bug 479403 addressing its root cause.
So after doing some research, this is probably best implemented as a session-management-backend in plasma-worspace in libkworkspace/sessionmanagementbackend.cpp¹. * New Class that implements and only allows logout. * logout by running the command: `x2goterminate-session` * Session status would be always Ready * Hook in initializer that uses the X2go-Backend if the `X2GO_SESSION` envoirnment variable is set before checking for logind after checking for the test session variable. ¹: https://invent.kde.org/plasma/plasma-workspace/-/blob/master/libkworkspace/sessionmanagementbackend.cpp Locking could be handled by running `x2gosuspendsession`, but that isn't handled by the backends yet.