Kwin effect for trackpad gestures
Open, Needs TriagePublic

zzag added a subscriber: zzag.Apr 15 2019, 10:46 PM

What is the purpose of this effect?

I would assume the purpose of the effect is visualize an in progress trackpad gesture. So for example, when you're swiping with 4 fingers to change your desktop, the effect could already start moving your desktop by a bit, to indicate you're performing a gesture.

As far as I've seen, an effect would need access to how much the gesture has processed, which is currently not possible, as far as I know. (I only have seen the Kwin codebase for about 2 hours, so correct me if I'm wrong) .

I've experimented with trying to implement gestures on the slide effect by directly sending the touchpad events to the effect itself, but that seems hacky in a way that it suddenly also would be responsible for actually switching the desktop, instead on relying on the GlobalShortcutManager to do so.

The most clean way in my opinion would be to somehow connect the effect to the progress signal from the SwipeGesture, which is in an InternalGlobalShortcut in the GlobalShortcutManager. If the QAction could have some kind of a progress signal, that would be nice, but on the other hand, might this be misusing the concept of an Action?

But that would only help for the present windows effect and the show grid effect, but not for the effects that only activate when the desktop is actually changed, like the slide effect. Would it be better to hand off the responsibility of actually changing the desktop to an effect? Or should Kwin add an progress parameter to void desktopChanged(int old, int current, EffectWindow *with); in an effect? The latter one keeps the responsibility of changing the desktop with Kwin, but the former one could allow for overscroll effects when you can't move to a desktop on your left, for example.

Anyway, I would really like to help out this task, since it's something that's on my personal wishlist. Since,a s mentioned before, this is the first time I looked at the Kwin, and even KDE, codebase, I might've seen some solutions to those problems over the head or made some mistakes.

Very nice, please feel free!