scripting: Make workspace.clientList include desktop windows on X11
AbandonedPublic

Authored by tcorreabr on May 5 2020, 8:39 PM.

Details

Reviewers
None
Group Reviewers
KWin
Summary

Some KWin scripts may need to access desktop windows Clients, to get their windowId's for example. And workspace.clientList doesn't include desktop windows on X11.

Diff Detail

Repository
R108 KWin
Lint
Lint Skipped
Unit
Unit Tests Skipped
tcorreabr created this revision.May 5 2020, 8:39 PM
Restricted Application added a project: KWin. · View Herald TranscriptMay 5 2020, 8:39 PM
Restricted Application added a subscriber: kwin. · View Herald Transcript
tcorreabr requested review of this revision.May 5 2020, 8:39 PM
zzag added a subscriber: zzag.May 6 2020, 7:12 AM

Hmm, this won't work on Wayland because desktop windows are mixed together with normal windows in workspace.clients. The only way to get a list of desktop windows is to filter them, e.g.

const desktops = workspace.clients.filter(client => client.desktopWindow);

I don't see any benefit from splitting X11 windows by type, could we just put desktop windows and other windows in a single list?

tcorreabr added a comment.EditedMay 6 2020, 7:58 PM

I just thought of a separate list to avoid impact in possible existing scripts that currently do not filter desktop windows and may need to.

But I agree that one list is better than two. And I think I can make that change.

tcorreabr retitled this revision from workspace.clientList doesn't have desktop windows to scripting: make the workspace.clientList include desktop windows on X11.May 6 2020, 9:18 PM
tcorreabr edited the summary of this revision. (Show Details)
tcorreabr retitled this revision from scripting: make the workspace.clientList include desktop windows on X11 to scripting: Make the workspace.clientList include desktop windows on X11.May 6 2020, 9:21 PM
tcorreabr retitled this revision from scripting: Make the workspace.clientList include desktop windows on X11 to scripting: Make workspace.clientList include desktop windows on X11.May 6 2020, 9:24 PM
zzag added a comment.May 7 2020, 5:51 AM

I just thought of a separate list to avoid impact in possible existing scripts that currently do not filter desktop windows and may need to.

But I agree that one list is better than two. And I think I can make that change.

Well, we're in a delicate situation here. If those scripts want to work on Wayland properly, they need to filter out desktop windows.

zzag added a comment.May 8 2020, 8:13 AM

D29522 is an alternative way to merge clientList() and desktopList().

tcorreabr abandoned this revision.May 12 2020, 10:10 PM