Bug 443725

Summary: Windows is not raised if single window/instance application is launched a second time
Product: [Plasma] kwin Reporter: Till Schäfer <till2.schaefer>
Component: wayland-genericAssignee: KWin default assignee <kwin-bugs-null>
Status: RESOLVED UPSTREAM    
Severity: normal CC: nate
Priority: NOR Keywords: wayland-only
Version First Reported In: 5.23.0   
Target Milestone: ---   
Platform: Gentoo Packages   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Till Schäfer 2021-10-14 15:49:18 UTC
When launching an already open single window/instance application (e.g. krusader or systemsettings) via shortcut, krunner, or kickoff, the window is not raised to the top under wayland. 

Under X11, the window is raised to the top, making it a very convenient way to switch to a special application without relying on alt+tab or the taskbar.  

This is also quite unexpected, if for example another systemsettings window is opened, but forgotten by the user. In this case it seems like launching systemsettings is not working at all. Instead, the systemsettings just update the displayed kcm. 

Focus stealing prevention is turned off. 

Operating System: Gentoo Linux
KDE Plasma Version: 5.23.0
KDE Frameworks Version: 5.87.0
Qt Version: 5.15.2
Kernel Version: 5.14.10-gentoo (64-bit)
Graphics Platform: Wayland
Processors: 8 × Intel® Core™ i7-4810MQ CPU @ 2.80GHz
Memory: 15.5 GiB of RAM
Graphics Processor: Mesa DRI Intel® HD Graphics 4600
Comment 1 Till Schäfer 2021-10-14 17:26:52 UTC
The above system settings example also applied to several places where the system settings are called from within plasma applets. E.g., when clicking "Configure Event Notifications and Actions" in the notification applet.
Comment 2 Nate Graham 2021-10-14 22:51:07 UTC
It's a known issue that requires every toolkit and app to opt into the new Wayland activation protocol that Aleix wrote recently. Support is already in GTK 4.2, and here is the patch for Qt: https://codereview.qt-project.org/c/qt/qtwayland/+/321246

Once that's done, 3rd-party apps will also need to opt in.

This is very annoying, I know. :(
Comment 3 Till Schäfer 2021-10-15 07:34:17 UTC
THX 4 info!

Sadly, the patch does not apply to latest qt5 qtwayland package ^^

will this be backported to qt 5 or will we have to wait for qt 6 adoption until this will is working?
Comment 4 Till Schäfer 2021-10-15 07:35:38 UTC
one more related question: is there a dbus interface to raise applications or something similar, to work around this issue in the meanwhile?
Comment 5 Nate Graham 2021-10-15 13:59:06 UTC
I don't have answers to those questions, sorry.
Comment 6 Till Schäfer 2021-10-18 10:59:36 UTC
If somebody else is looking for workarounds. Someone implemented a script raise an application via kwins scripting interface. 

https://github.com/academo/ww-run-raise