Bug 486918

Summary: On X11 cannot logout after starting another XServer
Product: [Plasma] plasmashell Reporter: Michael Dluhosch <michael.dluhosch>
Component: Session ManagementAssignee: Plasma Bugs List <plasma-bugs-null>
Status: RESOLVED INTENTIONAL    
Severity: minor CC: natalie_clarius, nate
Priority: NOR Keywords: X11-only
Version First Reported In: 6.0.4   
Target Milestone: 1.0   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

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
Comment 5 Nate Graham 2025-08-19 20:11:29 UTC
Closing as not worth fixing due to esoteric nature and a shift of focus away from X11.