SUMMARY Same as bug 423526 but for the screen locker. kscreenlocker also needs to be ported away from GetSessionByPID
It should be, it uses the same library
Which library? The fix in bug 423526 is for libkworkspace, and kscreenlocker doesn't use that. And it is calling GetSessionByPID in https://invent.kde.org/plasma/kscreenlocker/-/blob/master/logind.cpp#L103
From my recent investigations, the greeter uses the sessionsModel.canSwitchUser property (from org.kde.plasma.private.sessions) to determine whether the button should be shown, which in turn does use libkworkspace (KDisplayManager::isSwitchable()). See also my comments in bug#https://bugs.kde.org/show_bug.cgi?id=427673
I had a look at this on openSUSE Tumbleweed, which also has systemd 246 and this problem. The "Switch User" button is indeed missing because KDisplayManager::isSwitchable() returns false. For reference, here's the code of KDisplayManager::isSwitchable(): if (DMType == NewGDM || DMType == LightDM) { QDBusObjectPath currentSeat; if (getCurrentSeat(nullptr, ¤tSeat)) { SystemdSeat SDseat(currentSeat); if (SDseat.isValid()) { QVariant prop = SDseat.property("CanMultiSession"); if (prop.isValid()) return prop.toBool(); } ... (ConsoleKit stuff follows here) Now the problem is that with systemd 246, SDseat.property("CanMultiSession") yields QVariant(Invalid), i.e. apparently getting that property fails. Although, "qdbus-qt5 --system org.freedesktop.login1 /org/freedesktop/login1/seat/auto org.freedesktop.DBus.Properties.Get org.freedesktop.login1.Seat CanMultiSession" does work and returns true. But the property is not listed in qdbusviewer either. As a quick test, I changed the code to this: if (prop.isValid()) return prop.toBool(); else return true; // if the property cannot be get, assume that MultiSession is supported Now the button appears again, and user switching works (together with https://invent.kde.org/plasma/plasma-workspace/-/commit/c5fa3a15a444b0e7c9113b2dd0351e1cf7141d29, otherwise switching to an existing session just hangs on an empty screen ).
Maybe something like this would be necessary to get the "CanMultiSession" property as well? (this is from KDisplayManager::SystemdSeat, https://invent.kde.org/plasma/plasma-workspace/-/blob/master/libkworkspace/kdisplaymanager.cpp#L150 ) /* HACK to be able to extract a(so) type from QDBus, property doesn't do the trick */ QList<NamedDBusObjectPath> getSessions() { QDBusMessage message = QDBusMessage::createMethodCall(service(), path(), DBUS_PROPERTIES_IFACE, DBUS_PROPERTIES_GET); message << interface() << SYSTEMD_SESSIONS_PROPERTY; QDBusMessage reply = QDBusConnection::systemBus().call(message);
Thanks for the thorough investigation! Hopefully that means this can finally be knocked out. :)
Btw, @David Edmundson wrote in bug#423526 comment#15: > src/login/logind-seat-dbus.c: SD_BUS_PROPERTY("CanMultiSession", "b", property_get_const_true, 0, SD_BUS_VTABLE_PROPERTY_CONST|SD_BUS_VTABLE_HIDDEN), > > > So it does still exist, but it's hidden from introspection. > And always returns true anyway: 8f8cc84ba4612e74cd1e26898c6816e6e60fc4e9 which > makes our check somewhat redundant! So my "workaround" in comment#4 would probably be an acceptable fix? (I'd think falling back to the ConsoleKit code shouldn't be necessary anymore if we successfully did get a systemd seat already...)
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/436
Git commit f1393bc835ee28ceee54cdceb8d873622e36826a by Wolfgang Bauer. Committed on 10/11/2020 at 09:11. Pushed by wbauer into branch 'master'. Fix missing "Switch User" button on lockscreen with systemd 246 With newer systemd versions (since 246), getting the "CanMultiSession" property doesn't work anymore. It's hidden and always true, see https://github.com/systemd/systemd/commit/8f8cc84ba4612e74cd1e26898c6816e6e60fc4e9 and https://github.com/systemd/systemd/commit/c2b178d3cacad52eadc30ecc349160bc02d32a9c So let's just assume that it's supported if the property is invalid. FIXED-IN: 5.20.3 M +8 -0 libkworkspace/kdisplaymanager.cpp https://invent.kde.org/plasma/plasma-workspace/commit/f1393bc835ee28ceee54cdceb8d873622e36826a
Git commit 92b9d097ea6e154f273849f69053f6e9cccf7fa8 by Wolfgang Bauer. Committed on 10/11/2020 at 09:18. Pushed by wbauer into branch 'cherry-pick-f1393bc8'. Fix missing "Switch User" button on lockscreen with systemd 246 With newer systemd versions (since 246), getting the "CanMultiSession" property doesn't work anymore. It's hidden and always true, see https://github.com/systemd/systemd/commit/8f8cc84ba4612e74cd1e26898c6816e6e60fc4e9 and https://github.com/systemd/systemd/commit/c2b178d3cacad52eadc30ecc349160bc02d32a9c So let's just assume that it's supported if the property is invalid. FIXED-IN: 5.20.3 (cherry picked from commit f1393bc835ee28ceee54cdceb8d873622e36826a) M +8 -0 libkworkspace/kdisplaymanager.cpp https://invent.kde.org/plasma/plasma-workspace/commit/92b9d097ea6e154f273849f69053f6e9cccf7fa8
Git commit aaa7a59a6710a89f21ebd441616df13be5ba8fef by Wolfgang Bauer. Committed on 10/11/2020 at 09:19. Pushed by wbauer into branch 'Plasma/5.20'. Fix missing "Switch User" button on lockscreen with systemd 246 With newer systemd versions (since 246), getting the "CanMultiSession" property doesn't work anymore. It's hidden and always true, see https://github.com/systemd/systemd/commit/8f8cc84ba4612e74cd1e26898c6816e6e60fc4e9 and https://github.com/systemd/systemd/commit/c2b178d3cacad52eadc30ecc349160bc02d32a9c So let's just assume that it's supported if the property is invalid. FIXED-IN: 5.20.3 (cherry picked from commit f1393bc835ee28ceee54cdceb8d873622e36826a) M +8 -0 libkworkspace/kdisplaymanager.cpp https://invent.kde.org/plasma/plasma-workspace/commit/aaa7a59a6710a89f21ebd441616df13be5ba8fef
*** Bug 430271 has been marked as a duplicate of this bug. ***
So I am running arch linux with extra/kscreenlocker 5.20.4-1 and I do not have switcher user, when the screen is locked, is there some extra step to get this working?
(In reply to Jason Pollitt from comment #13) > So I am running arch linux with extra/kscreenlocker 5.20.4-1 and I do not > have switcher user, when the screen is locked, is there some extra step to > get this working? The fix is in plasma-workspace (not kscreenlocker), since 5.20.3. But no, there should be no extra step necessary. If you have plasma-workspace 5.20.4 (or 5.20.3), it should work (you'd have to logout/login or reboot of course after installing the update). It certainly works fine again in the latest openSUSE Tumbleweed (with systemd 246.7 and Plasma 5.20.4 meanwhile), I just tried a LiveCD.
(In reply to Wolfgang Bauer from comment #14) Thanks, maybe I had not rebooted since the update all is working now. > (In reply to Jason Pollitt from comment #13) > > So I am running arch linux with extra/kscreenlocker 5.20.4-1 and I do not > > have switcher user, when the screen is locked, is there some extra step to > > get this working? > > The fix is in plasma-workspace (not kscreenlocker), since 5.20.3. > > But no, there should be no extra step necessary. If you have > plasma-workspace 5.20.4 (or 5.20.3), it should work (you'd have to > logout/login or reboot of course after installing the update). > > It certainly works fine again in the latest openSUSE Tumbleweed (with > systemd 246.7 and Plasma 5.20.4 meanwhile), I just tried a LiveCD.
This continues to not operate for me. When I attempt to switch users after hitting Ctrl+L, the login page appears for a second, but is replaced by the Unlock button with a sliding-left animation.
That's a different issue. This bug report is about the functionality being missing; you're reporting that it's present, but doesn't work for you.