Bug 401309 - Scripts do not get wayland clients
Summary: Scripts do not get wayland clients
Status: RESOLVED WORKSFORME
Alias: None
Product: kwin
Classification: Plasma
Component: scripting (show other bugs)
Version: 5.14.3
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
: 401308 (view as bug list)
Depends on:
Blocks:
 
Reported: 2018-11-22 16:44 UTC by Fabian Homborg
Modified: 2021-12-07 04:36 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Fabian Homborg 2018-11-22 16:44:11 UTC
SUMMARY
The kwin scripting interface has no access to wayland clients.

workspace.clientAdded does not fire for them, workspace.clientList does not contain them. This renders the interface moot on wayland.

STEPS TO REPRODUCE
1. Run a script that goes through workspace.clientlist
2. See it only shows X11/XWayland clients
3. Switch back to X11

OBSERVED RESULT
No wayland clients seen.


EXPECTED RESULT
Wayland clients seen.


SOFTWARE/OS VERSIONS
Windows: 
MacOS: 
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 5.14.3
KDE Frameworks Version: 5.52.0
Qt Version: 5.11.2

ADDITIONAL INFORMATION
Comment 1 Vlad Zahorodnii 2018-11-22 16:55:03 UTC
*** Bug 401308 has been marked as a duplicate of this bug. ***
Comment 2 Vlad Zahorodnii 2018-11-22 16:57:10 UTC
Hi! Are you the author of https://github.com/faho/kwin-tiling?
Comment 3 Fabian Homborg 2018-11-22 16:59:00 UTC
Yes, I am.
Comment 4 Vlad Zahorodnii 2018-11-22 17:14:19 UTC
Cool! I uploaded patches to expose wayland clients to the scripting api earlier today:
* https://phabricator.kde.org/D17096
* https://phabricator.kde.org/D17097

In order to make your script work with wayland clients, you'll have to make the following checks X11-specific:
* https://github.com/faho/kwin-tiling/blob/master/contents/code/tile.js#L215
* https://github.com/faho/kwin-tiling/blob/master/contents/code/tile.js#L283
* https://github.com/faho/kwin-tiling/blob/master/contents/code/tile.js#L300
Comment 5 Fabian Homborg 2018-11-22 17:18:38 UTC
How exactly would I do that? Is there some way to detect that we're running under wayland? Or that the client is a wayland one, given that I'd assume XWayland clients still have a basicUnit?

(The "managed" check is pure defensive programming anyway, I've never seen that fail)
Comment 6 kde.org 2021-11-07 10:34:06 UTC
This issue report is quite old and Vlad mentions, that he added some code to fix this issue. Can you please confirm, that it still persists with Plasma 5.23?
Comment 7 Bug Janitor Service 2021-11-22 04:38:58 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least
15 days. Please provide the requested information as soon as
possible and set the bug status as REPORTED. Due to regular bug
tracker maintenance, if the bug is still in NEEDSINFO status with
no change in 30 days the bug will be closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please
mark the bug as REPORTED so that the KDE team knows that the bug is
ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 8 Bug Janitor Service 2021-12-07 04:36:35 UTC
This bug has been in NEEDSINFO status with no change for at least
30 days. The bug is now closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

Thank you for helping us make KDE software even better for everyone!