https://bugs.kde.org/show_bug.cgi?id=469839
Bug ID: 469839 Summary: X11 applications may not autostart properly in a Wayland session Classification: Plasma Product: plasmashell Version: 5.27.5 Platform: Archlinux OS: Linux Status: REPORTED Severity: normal Priority: NOR Component: Startup process Assignee: plasma-b...@kde.org Reporter: einbert-xer...@outlook.com CC: k...@davidedmundson.co.uk Target Milestone: 1.0 SUMMARY Autostarted applications may miss some important environment variables crucial for properly starting X11 applications in a Wayland session. STEPS TO REPRODUCE 1. Add any X11 application to the autostarted application list. 2. Restart and watch how it behaves. OBSERVED RESULT It depends (it may hang or may not start). Generally can't be considered as "working". EXPECTED RESULT It shoud work as in X11 sessions. SOFTWARE/OS VERSIONS Linux/KDE Plasma: Arch Linux, Wayland sessions only (available in About System) KDE Plasma Version: 5.27.5 KDE Frameworks Version: 5.106.0 Qt Version: 5.15.9 ADDITIONAL INFORMATION This is found when investigating Jetbrains Toolbox hang when autostarted in a Wayland session. JB Toolbox will show a tray icon and then freeze, with 100% CPU usage and no respond to click on the tray icon (which will typically open the JB Toolbox window). This issue exists for at least months. Such issue will disappear if manually started from the application launcher, or by manually invoking `<dir-of-toolbox-bin>/jetbrains-toolbox --minimize`. A simple perf shows that JB Toolbox is busy calling `xcb_wait_for_event` during the hang. It also doesn't appear in the output of `xlsclients` during the hang. After that I guessed that this issue may related to autostarting X11 applications in KDE. So I made another attempt of autostarting Chrome in a Wayland session. Due to a Chrome 113 bug I'm using it without `--ozone-platform-hint=auto` which will make Chrome always use X11. Autostarting an X11 Chrome doesn't work as well. No window is displayed and the chrome process simply quits. After further investigation I found that autostarted applications don't have some special environment variables, namely: - DISPLAY - GTK2_RC_FILES - GTK_RC_FILES - SESSION_MANAGER - WAYLAND_DISPLAY - XAUTHORITY and have these environment variables different from manually started applications: - INVOCATION_ID - JOURNAL_STREAM And found two of these environment variables are necessary: - DISPLAY: unset this one makes JB Toolbox hang, as behaved when autostarted. - XAUTHORITY: unset this one makes JB Toolbox quit with status code 44. PS: There's another issue I once encountered that is also related to autostart. Autostarted KeePassXC will use a bright theme instead of the dark theme (I uses Breeze Dark) when [View -> Theme] is [Automatic]. It will properly use the dark theme when manually started. This may also be a plasma issue as it started to appear after a plasma upgrade months ago, and appears on X11 session as well. I didn't pay much effort investigating it as it's not as frustrating as a hanging application, and may simply disappear after the huge refactoring towards KDE 6. -- You are receiving this mail because: You are watching all bug changes.