Bug 514039

Summary: Autostarted applications crash on Plasma 6 Wayland because they launch before the session is ready
Product: [Plasma] plasmashell Reporter: lucasrizzini <lucasrizzini>
Component: Startup processAssignee: Plasma Bugs List <plasma-bugs-null>
Status: NEEDSINFO WAITINGFORINFO    
Severity: crash CC: kde
Priority: NOR    
Version First Reported In: 6.5.4   
Target Milestone: 1.0   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: Complete boot log (journalctl -b) showing autostart crashes. Aplications: keepassxc, copyq and easyeffects.

Description lucasrizzini 2026-01-01 13:06:10 UTC
Applications started via Autostart in Plasma 6 on Wayland are launched before the graphical session is fully ready. As a result, several applications crash at login with errors such as Failed to create wl_display or qt.qpa.xcb: could not connect to display. The systemd-user autostart units should wait for the Wayland session (or compositor availability) before execution to prevent these early-start failures.

SUMMARY


STEPS TO REPRODUCE

1. Install KDE Plasma with Wayland.
2. Add applications to autostart using .desktop files.
3. Log out and log back in, or reboot the system.

OBSERVED RESULT
Applications fail to start and crash with errors such as “Failed to create wl_display (No such file or directory)” or “qt.qpa.xcb: could not connect to display”.

EXPECTED RESULT
Autostarted applications should only launch after the Wayland session is fully initialized, allowing them to successfully connect to the display and start without errors or crashes.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma:
KDE Plasma Version: 6.5.4
KDE Frameworks Version: 6.21.0
Qt Version: 6.10.1
Kernel Version: 6.18.2-arch2-1 (64-bit)
Graphics Platform: Wayland

Hardware:
Processors: 4 × Intel® Core™ i3-8100 CPU @ 3.60GHz
Memory: 8 GiB RAM
Graphics Processor: Intel® UHD Graphics 630
Storage device: SAMSUNG HD154UI 1,5 TB, 5400 RPM SATA2

ADDITIONAL INFORMATION
I suspect this might be happening because of the slow storage device. I'm not sure which exact version it started in, but it was in November. As a workaround, I created a small script to delay the startup of the affected applications by a few seconds. This works because it ensures the Wayland display (wl_display) is available before the applications are launched. However, this is not a proper solution since Autostart should already wait for the session to be ready.

Script:
#!/bin/bash
sleep 5
copyq --start-server & disown
keepassxc & disown
/home/lucas/scripts/easy.effects_in_background.sh & disown
Comment 1 David Edmundson 2026-01-01 15:50:25 UTC
>Autostarted applications should only launch after the Wayland session is fully initialized

They do 

Please provide output of journalctl --user -b 

After a reboot without your workarounds.
Comment 2 lucasrizzini 2026-01-01 19:17:00 UTC
Created attachment 188140 [details]
Complete boot log (journalctl -b) showing autostart crashes. Aplications: keepassxc, copyq and easyeffects.
Comment 3 lucasrizzini 2026-01-01 19:18:34 UTC
(In reply to David Edmundson from comment #1)
> >Autostarted applications should only launch after the Wayland session is fully initialized
> 
> They do 
> 
> Please provide output of journalctl --user -b 
> 
> After a reboot without your workarounds.

journalctl --user -b is empty:
No journal files were found.
-- No entries --

However, journalctl -b I just does contain messages related to applications failing early due to missing Wayland display initialization. Since this might be relevant, I attached the full journalctl -b to the bug report.