<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.kde.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugs.kde.org/"
          
          maintainer="sysadmin@kde.org"
>

    <bug>
          <bug_id>427777</bug_id>
          
          <creation_ts>2020-10-15 20:37:53 +0000</creation_ts>
          <short_desc>Missing &quot;switch user&quot; functionality in lock screen with systemd 246</short_desc>
          <delta_ts>2022-08-25 07:08:44 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>10</classification_id>
          <classification>Unmaintained</classification>
          <product>kscreenlocker</product>
          <component>greeter</component>
          <version>unspecified</version>
          <rep_platform>Other</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          <see_also>https://bugs.kde.org/show_bug.cgi?id=423526</see_also>
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>regression</keywords>
          <priority>VHI</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Antonio Rojas">arojas</reporter>
          <assigned_to name="Plasma Bugs List">plasma-bugs-null</assigned_to>
          <cc>4wy78uwh</cc>
    
    <cc>bshah</cc>
    
    <cc>kde</cc>
    
    <cc>kde</cc>
    
    <cc>nate</cc>
    
    <cc>snostormjp</cc>
    
    <cc>wbauer1</cc>
          
          <cf_commitlink>https://invent.kde.org/plasma/plasma-workspace/commit/aaa7a59a6710a89f21ebd441616df13be5ba8fef</cf_commitlink>
          <cf_versionfixedin>5.20.3</cf_versionfixedin>
          <cf_sentryurl></cf_sentryurl>
          <votes>0</votes>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1965287</commentid>
    <comment_count>0</comment_count>
    <who name="Antonio Rojas">arojas</who>
    <bug_when>2020-10-15 20:37:53 +0000</bug_when>
    <thetext>SUMMARY
Same as bug 423526 but for the screen locker. kscreenlocker also needs to be ported away from GetSessionByPID</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1965304</commentid>
    <comment_count>1</comment_count>
    <who name="David Edmundson">kde</who>
    <bug_when>2020-10-15 22:21:25 +0000</bug_when>
    <thetext>It should be, it uses the same library</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1965306</commentid>
    <comment_count>2</comment_count>
    <who name="Antonio Rojas">arojas</who>
    <bug_when>2020-10-15 22:44:42 +0000</bug_when>
    <thetext>Which library? The fix in bug 423526 is for libkworkspace, and kscreenlocker doesn&apos;t use that. And it is calling GetSessionByPID in https://invent.kde.org/plasma/kscreenlocker/-/blob/master/logind.cpp#L103</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1965504</commentid>
    <comment_count>3</comment_count>
    <who name="Wolfgang Bauer">wbauer1</who>
    <bug_when>2020-10-16 14:40:34 +0000</bug_when>
    <thetext>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</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1972261</commentid>
    <comment_count>4</comment_count>
    <who name="Wolfgang Bauer">wbauer1</who>
    <bug_when>2020-11-06 08:16:27 +0000</bug_when>
    <thetext>I had a look at this on openSUSE Tumbleweed, which also has systemd 246 and this problem.

The &quot;Switch User&quot; button is indeed missing because KDisplayManager::isSwitchable() returns false.

For reference, here&apos;s the code of KDisplayManager::isSwitchable():
    if (DMType == NewGDM || DMType == LightDM) {
        QDBusObjectPath currentSeat;
        if (getCurrentSeat(nullptr, &amp;currentSeat)) {
            SystemdSeat SDseat(currentSeat);
            if (SDseat.isValid()) {
                QVariant prop = SDseat.property(&quot;CanMultiSession&quot;);
                if (prop.isValid())
                    return prop.toBool();
            }
... (ConsoleKit stuff follows here)

Now the problem is that with systemd 246, SDseat.property(&quot;CanMultiSession&quot;) yields QVariant(Invalid), i.e. apparently getting that property fails.

Although, &quot;qdbus-qt5 --system org.freedesktop.login1 /org/freedesktop/login1/seat/auto org.freedesktop.DBus.Properties.Get org.freedesktop.login1.Seat CanMultiSession&quot; 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 ).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1972262</commentid>
    <comment_count>5</comment_count>
    <who name="Wolfgang Bauer">wbauer1</who>
    <bug_when>2020-11-06 08:26:59 +0000</bug_when>
    <thetext>Maybe something like this would be necessary to get the &quot;CanMultiSession&quot; 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&apos;t do the trick */
    QList&lt;NamedDBusObjectPath&gt; getSessions() {
        QDBusMessage message = QDBusMessage::createMethodCall(service(), path(), DBUS_PROPERTIES_IFACE, DBUS_PROPERTIES_GET);
        message &lt;&lt;  interface() &lt;&lt; SYSTEMD_SESSIONS_PROPERTY;
        QDBusMessage reply = QDBusConnection::systemBus().call(message);</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1972329</commentid>
    <comment_count>6</comment_count>
    <who name="Nate Graham">nate</who>
    <bug_when>2020-11-06 16:26:55 +0000</bug_when>
    <thetext>Thanks for the thorough investigation! Hopefully that means this can finally be knocked out. :)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1973180</commentid>
    <comment_count>7</comment_count>
    <who name="Wolfgang Bauer">wbauer1</who>
    <bug_when>2020-11-09 09:04:35 +0000</bug_when>
    <thetext>Btw, @David Edmundson wrote in bug#423526 comment#15:
&gt; src/login/logind-seat-dbus.c:        SD_BUS_PROPERTY(&quot;CanMultiSession&quot;, &quot;b&quot;, property_get_const_true, 0, SD_BUS_VTABLE_PROPERTY_CONST|SD_BUS_VTABLE_HIDDEN),
&gt; 
&gt; 
&gt; So it does still exist, but it&apos;s hidden from introspection.
&gt; And always returns true anyway: 8f8cc84ba4612e74cd1e26898c6816e6e60fc4e9 which &gt; makes our check somewhat redundant!

So my &quot;workaround&quot; in comment#4 would probably be an acceptable fix?

(I&apos;d think falling back to the ConsoleKit code shouldn&apos;t be necessary anymore if we successfully did get a systemd seat already...)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1973213</commentid>
    <comment_count>8</comment_count>
    <who name="Bug Janitor Service">bug-janitor</who>
    <bug_when>2020-11-09 11:32:00 +0000</bug_when>
    <thetext>A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/436</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1973646</commentid>
    <comment_count>9</comment_count>
    <who name="Wolfgang Bauer">wbauer1</who>
    <bug_when>2020-11-10 09:18:03 +0000</bug_when>
    <thetext>Git commit f1393bc835ee28ceee54cdceb8d873622e36826a by Wolfgang Bauer.
Committed on 10/11/2020 at 09:11.
Pushed by wbauer into branch &apos;master&apos;.

Fix missing &quot;Switch User&quot; button on lockscreen with systemd 246

With newer systemd versions (since 246), getting the &quot;CanMultiSession&quot; property
doesn&apos;t work anymore.

It&apos;s hidden and always true, see https://github.com/systemd/systemd/commit/8f8cc84ba4612e74cd1e26898c6816e6e60fc4e9
and https://github.com/systemd/systemd/commit/c2b178d3cacad52eadc30ecc349160bc02d32a9c

So let&apos;s just assume that it&apos;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</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1973647</commentid>
    <comment_count>10</comment_count>
    <who name="Wolfgang Bauer">wbauer1</who>
    <bug_when>2020-11-10 09:18:52 +0000</bug_when>
    <thetext>Git commit 92b9d097ea6e154f273849f69053f6e9cccf7fa8 by Wolfgang Bauer.
Committed on 10/11/2020 at 09:18.
Pushed by wbauer into branch &apos;cherry-pick-f1393bc8&apos;.

Fix missing &quot;Switch User&quot; button on lockscreen with systemd 246

With newer systemd versions (since 246), getting the &quot;CanMultiSession&quot; property
doesn&apos;t work anymore.

It&apos;s hidden and always true, see https://github.com/systemd/systemd/commit/8f8cc84ba4612e74cd1e26898c6816e6e60fc4e9
and https://github.com/systemd/systemd/commit/c2b178d3cacad52eadc30ecc349160bc02d32a9c

So let&apos;s just assume that it&apos;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</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1973649</commentid>
    <comment_count>11</comment_count>
    <who name="Wolfgang Bauer">wbauer1</who>
    <bug_when>2020-11-10 09:20:00 +0000</bug_when>
    <thetext>Git commit aaa7a59a6710a89f21ebd441616df13be5ba8fef by Wolfgang Bauer.
Committed on 10/11/2020 at 09:19.
Pushed by wbauer into branch &apos;Plasma/5.20&apos;.

Fix missing &quot;Switch User&quot; button on lockscreen with systemd 246

With newer systemd versions (since 246), getting the &quot;CanMultiSession&quot; property
doesn&apos;t work anymore.

It&apos;s hidden and always true, see https://github.com/systemd/systemd/commit/8f8cc84ba4612e74cd1e26898c6816e6e60fc4e9
and https://github.com/systemd/systemd/commit/c2b178d3cacad52eadc30ecc349160bc02d32a9c

So let&apos;s just assume that it&apos;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</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1985195</commentid>
    <comment_count>12</comment_count>
    <who name="Nate Graham">nate</who>
    <bug_when>2020-12-17 05:24:20 +0000</bug_when>
    <thetext>*** Bug 430271 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1986777</commentid>
    <comment_count>13</comment_count>
    <who name="Jason Pollitt">snostormjp</who>
    <bug_when>2020-12-19 13:33:16 +0000</bug_when>
    <thetext>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?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1987260</commentid>
    <comment_count>14</comment_count>
    <who name="Wolfgang Bauer">wbauer1</who>
    <bug_when>2020-12-21 10:31:38 +0000</bug_when>
    <thetext>(In reply to Jason Pollitt from comment #13)
&gt; So I am running arch linux with extra/kscreenlocker 5.20.4-1  and I do not
&gt; have switcher user, when the screen is locked, is there some extra step to
&gt; 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&apos;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.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1987608</commentid>
    <comment_count>15</comment_count>
    <who name="Jason Pollitt">snostormjp</who>
    <bug_when>2020-12-22 18:15:20 +0000</bug_when>
    <thetext>(In reply to Wolfgang Bauer from comment #14)
Thanks, maybe I had not rebooted since the update all is working now.


&gt; (In reply to Jason Pollitt from comment #13)
&gt; &gt; So I am running arch linux with extra/kscreenlocker 5.20.4-1  and I do not
&gt; &gt; have switcher user, when the screen is locked, is there some extra step to
&gt; &gt; get this working?
&gt; 
&gt; The fix is in plasma-workspace (not kscreenlocker), since 5.20.3.
&gt; 
&gt; But no, there should be no extra step necessary. If you have
&gt; plasma-workspace 5.20.4 (or 5.20.3), it should work  (you&apos;d have to
&gt; logout/login or reboot of course after installing the update).
&gt; 
&gt; It certainly works fine again in the latest openSUSE Tumbleweed (with
&gt; systemd 246.7 and Plasma 5.20.4 meanwhile), I just tried a LiveCD.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2147650</commentid>
    <comment_count>16</comment_count>
    <who name="Roke Julian Lockhart Beedell">4wy78uwh</who>
    <bug_when>2022-08-23 16:51:48 +0000</bug_when>
    <thetext>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.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2147951</commentid>
    <comment_count>17</comment_count>
    <who name="Nate Graham">nate</who>
    <bug_when>2022-08-25 07:08:44 +0000</bug_when>
    <thetext>That&apos;s a different issue. This bug report is about the functionality being missing; you&apos;re reporting that it&apos;s present, but doesn&apos;t work for you.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>