Add diagonal virtual desktop switching
This allows switching virtual desktops in any direction with the 3-finger touchpad gesture.
This is basically another, slightly more restrictive, approach to the stale (?) !4443 (closed) by @niccolove. For example, switch desktops left/right while going into overview mode with the 4-finger touchpad gesture will not work. Switching desktops once in the overview effect is not an issue.
A few points for review:
- When switching diagonally, it's not always obvious which VD to go to if the grid isn't square. Try for example 7 desktops on 3 rows. I think my approach makes sense, but there might be a simpler way (
gestureReleased()
). - I would have loved to add some tests that check if switching works as expected, but I have no idea how to go about that.
- I modified an enum in
globals.h
, and I'm not sure if that's ok or there's versioning considerations for such high-level interfaces. - I'm not happy that the
progress
anddeltaProgress
signals, besides not having very distinctive naming, do not use the same units. The first is normalized tominimumDelta
, while the second is in points. This means it had to be normalized in the callback, so I exposed the 200pt value in theGlobalShortcut
class header. However one could create a new signal if that's desired. - Generally, this is my first time contributing to KWin, so let me know if anything looks out of place or is plain wrong.
If you think this is not the good approach or !4443 (closed) has more potential, that's also fine for me. Also consider compatibility with !6607.
Edited by Thomas Moerschell