Bug 385595

Summary: KWin::WorkspaceWrapper signal clientAdded(KWin::Client *client) doesn't trigger on Wayland
Product: [Plasma] kwin Reporter: jasu.koponen
Component: scriptingAssignee: KWin default assignee <kwin-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: acidrums4+stuff, jsardid, nate
Priority: NOR    
Version: 5.11.0   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description jasu.koponen 2017-10-11 11:44:00 UTC
KWin Scripts can't detect new clients on Wayland, unless the program is using XWayland. 


Steps to reproduce: 

1. Open the "WM Console" through KRunner.

2. Insert the following:
workspace.clientAdded.connect(function() { print("added"); })
workspace.clientRemoved.connect(function() { print("removed"); })

3. Execute

4. Start a Qt program and the script prints nothing, start a GTK2 program and the script prints "added". When removing a Qt program the script prints "removed".
Comment 1 Martin Flöser 2017-10-11 15:03:33 UTC
Yes, this is on purpose. We don't have a security concept yet for Scripts on Wayland, so Wayland windows are excluded from scripting.

I have an idea for how to implement the security. Once that is in, scripting will be activated.
Comment 2 avlas 2018-06-22 13:47:07 UTC
wondering whether there is any progress regarding this issue... thanks!