Bug 473968

Summary: Preference to launch app on Xwayland is ignored at session restoration
Product: [Plasma] plasmashell Reporter: Andrew Shark <ashark>
Component: Session ManagementAssignee: Plasma Bugs List <plasma-bugs-null>
Status: CONFIRMED ---    
Severity: minor CC: nate
Priority: NOR Keywords: wayland-only
Version First Reported In: 5.27.7   
Target Milestone: 1.0   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Andrew Shark 2023-08-31 00:14:11 UTC
For the apps that you launch in XWayland, the session restoration launches them as native Wayland apps.

I am using Qt Creator, and it has some graphical glitches on Wayland (dialog windows shown with transparent areas until resized manually or moved to another screen). I have edited the launcher to use X11.
Now, when I reboot, the app is restored, but it is launched natively on Wayland.

STEPS TO REPRODUCE
1. My `System Settings | Desktop Session | On login, launch apps that were open` is set to `On last logout`.
2. Install Qt Creator. Edit the application with right click, in the Application tab add the `QT_QPA_PLATFORM=xcb` variable.
3. Open Qt Creator.
4. Reboot.
5. Log in to the Plasma Wayland session.
6. The Qt Creator is auto launched.

OBSERVED RESULT
It is launched natively on wayland platform. 

EXPECTED RESULT
The restoration should respect the user preference to launch the app with xcb platform.

SOFTWARE/OS VERSIONS
Operating System: Arch Linux 
KDE Plasma Version: 5.27.7
KDE Frameworks Version: 5.109.0
Qt Version: 5.15.10
Graphics Platform: Wayland
Qt Creator: 11.0.1 (Based on Qt 6.5.2)

ADDITIONAL INFORMATION
As a workaround, I can add it to the Ignored applications in the System Settings.
Comment 1 Nate Graham 2023-08-31 15:01:14 UTC
Apps restored via session management aren't being launched normally such that their desktop files are run; they're doing a special thing using the X11 session restore protocols. I'm not sure there's a clean way to fix this.