Bug 486918 - On X11 cannot logout after starting another XServer
Summary: On X11 cannot logout after starting another XServer
Status: REPORTED
Alias: None
Product: plasmashell
Classification: Plasma
Component: Session Management (show other bugs)
Version: 6.0.4
Platform: Arch Linux Linux
: NOR normal
Target Milestone: 1.0
Assignee: Plasma Bugs List
URL:
Keywords: X11-only
Depends on:
Blocks:
 
Reported: 2024-05-12 12:56 UTC by Michael Dluhosch
Modified: 2025-02-24 17:58 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Dluhosch 2024-05-12 12:56:23 UTC
SUMMARY
When starting a seconds X11 session (with the same user that started the kde desktop) for example via startx then I cannot logout anymore from the plasma desktop. Following error pops up in the journalctl:

ksmserver-logout-greeter[4361]: qt.qpa.xcb: could not connect to display :1

STEPS TO REPRODUCE
1.  login to plasma and do a systemctl --user show-environment -> note down DISPLAY and XAUTHORITY
2.  startx from another tty as the same user
3.  switch to plasma and do a  systemctl --user show-environment -> env variables have changed
4. try to logout or restart the computer -> nothing happens

OBSERVED RESULT
I cannot logout or restart

EXPECTED RESULT
I can logout or restart

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 6.0.4
KDE Frameworks Version: 6.1.0
Qt Version: 6.7.0

ADDITIONAL INFORMATION
Maybe a easy fix is doing a systemctl --user import-environment XAUTHORITY DISPLAY just after the user clicks on logout,restart etc. So that the ksmserver-logout-greeter has no chance of using the wrong env variables.
Comment 1 Nate Graham 2024-07-31 04:07:13 UTC
This may be a bug, but it's definitely not something we formally support. I estimate it to have a very low chance of being fixed unless you can provide a patch. Would you ve interested in doing so?
Comment 2 Michael Dluhosch 2024-07-31 17:37:50 UTC
(In reply to Nate Graham from comment #1)
> This may be a bug, but it's definitely not something we formally support. I
> estimate it to have a very low chance of being fixed unless you can provide
> a patch. Would you ve interested in doing so?

Sure I can try to come up with something. Can you point me into the right direction? I think it should happen before the ksmserver-logout-greeter binary is invoked. Or maybe it should be fixed by systemd? If KDE does not handle the DISPLAY and XAUTHORITY variables at all then maybe it should not start doing so?
Comment 3 Nate Graham 2024-07-31 20:18:23 UTC
I'm afraid that can't be me. I don't know anything about how X11 stuff works.
Comment 4 TraceyC 2025-02-24 17:58:26 UTC
Adding the x11-only keyword