https://bugs.kde.org/show_bug.cgi?id=523545

            Bug ID: 523545
           Summary: Switching users from a KDE Plasma session does not
                    work when using GDM as the display manager.
    Classification: Plasma
           Product: plasmashell
      Version First 6.7.3
       Reported In:
          Platform: Arch Linux
                OS: Linux
            Status: REPORTED
          Severity: normal
          Priority: NOR
         Component: Session Management
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]
  Target Milestone: 1.0

Created attachment 194636
  --> https://bugs.kde.org/attachment.cgi?id=194636&action=edit
Diagnostic outputs for GDM user switching issue.

# User switching does not work in Plasma Wayland session when using GDM 50.1

## Summary

Switching users from a KDE Plasma session does not work when using GDM as the
display manager.

When attempting to switch users, Plasma logs:

```text
Cannot switch user: XDG_SEAT_PATH not set
```

The session itself appears to be correctly registered with systemd-logind, but
Plasma's current implementation appears to depend on a display manager D-Bus
interface that is not provided by modern GDM.

## Environment

* Distribution: Arch Linux x86_64
* KDE Plasma: 6.7.3
* GDM: 50.1
* systemd: 261 (261.1-1-arch)
* Session type: Wayland
* Window manager: KWin (Wayland)

## Steps to reproduce

1. Use GDM as the display manager.
2. Log into a KDE Plasma Wayland session.
3. Open the Plasma session menu.
4. Select "Switch User".

## Expected behavior

The system should switch to the login greeter and allow another user to log in.

## Actual behavior

Nothing happens.

The following warning is logged:

```text
Cannot switch user: XDG_SEAT_PATH not set
```

## Investigation

The warning originates from `libkworkspace` in
`SessionManagement::switchUser()`:

```cpp
if (!qEnvironmentVariableIsSet("XDG_SEAT_PATH")) {
    qCWarning(LIBKWORKSPACE_DEBUG) << "Cannot switch user: XDG_SEAT_PATH not
set";
    return;
}
```

The function then uses `XDG_SEAT_PATH` to call:

```text
org.freedesktop.DisplayManager.Seat.SwitchToGreeter
```

However, on this system:

### systemd-logind correctly knows the session seat

`loginctl` reports the session seat as:

```text
seat0
```

so the session appears to be correctly registered with logind.

### The expected DisplayManager D-Bus service is not available

Running:

```sh
busctl tree org.freedesktop.DisplayManager
```

returns:

```text
Failed to introspect object / of service org.freedesktop.DisplayManager: The
name is not activatable
No objects discovered.
```

### GDM exposes a different D-Bus service

Running:

```sh
busctl --system list | grep -i gdm
```

shows:

```text
org.gnome.DisplayManager
```

The exported object tree is:

```text
/org/gnome/DisplayManager
├── Displays
├── LocalDisplayFactory
├── Manager
└── RemoteDisplayFactory
```

The manager interface exposes:

```text
org.gnome.DisplayManager.Manager
    OpenSession
    OpenReauthenticationChannel
    RegisterDisplay
    RegisterSession
```

but there does not appear to be a `SwitchToGreeter` method or a seat object
equivalent to:

```text
org.freedesktop.DisplayManager.Seat
```

## Question

Is Plasma's current user switching implementation relying on an obsolete
display manager interface?

Should user switching be implemented through systemd-logind or GDM's current
D-Bus API instead of relying on `XDG_SEAT_PATH` and
`org.freedesktop.DisplayManager.Seat.SwitchToGreeter`?

I am happy to provide additional logs or test patches if need

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to