Scripting: Provides methods to create and remove virtual desktops
ClosedPublic

Authored by tcorreabr on Fri, May 15, 7:06 PM.

Details

Summary

There are methods to create and remove virtual desktops via dbus, but I think it would be convenient to provide these methods for KWin scripts as well.

Diff Detail

Repository
R108 KWin
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
tcorreabr created this revision.Fri, May 15, 7:06 PM
Restricted Application added a project: KWin. · View Herald TranscriptFri, May 15, 7:06 PM
Restricted Application added a subscriber: kwin. · View Herald Transcript
tcorreabr requested review of this revision.Fri, May 15, 7:06 PM
zzag added a subscriber: zzag.Mon, May 18, 9:00 AM
zzag added inline comments.
scripting/workspace_wrapper.h
260

why not in range [0, count]?

zzag added inline comments.Mon, May 18, 9:02 AM
scripting/workspace_wrapper.cpp
282–283

coding style nit: whitespace before * and put the return statement on a new line.

tcorreabr added inline comments.Mon, May 18, 3:45 PM
scripting/workspace_wrapper.cpp
282–283

Ok. I'll do it.

scripting/workspace_wrapper.h
260

I don't know why but the client.desktop property is not zero based, at least on X11. So in a situation with 2 desktops, the new desktop can be inserted at position 1, 2 or 3.

zzag added inline comments.Tue, May 19, 10:02 AM
scripting/workspace_wrapper.h
260

I don't know why but the client.desktop property is not zero based

It's not zero-based because of the goddamn X11...

So in a situation with 2 desktops, the new desktop can be inserted at position 1, 2 or 3.

In order to match what input values VirtualDesktopManager::createVirtualDesktop() expects, I think it's better to keep the position in range [0, count]. We could make client.desktop zero-based in plasma 6.

It's also worth to point out that the client.desktop property is deprecated since a window can be on more than just one virtual desktop.

tcorreabr updated this revision to Diff 83097.Wed, May 20, 10:48 PM

Zero based position parameters.

tcorreabr marked 5 inline comments as done.Wed, May 20, 10:49 PM
zzag accepted this revision.Thu, May 21, 5:50 AM
This revision is now accepted and ready to land.Thu, May 21, 5:50 AM
This revision was automatically updated to reflect the committed changes.