Skip to content

Allow customization of touch screen border gesture activation distance

In EffectTogglableTouchBorder::setBorders a maxDelta parameter is added to allow setting the variable outside (where it was hardcoded before). The parameter is optional and defaults to the previous hardcoded value which should make it fully backwards compatible.

The reason for this is that Plasma Mobile now utilizes KWin's TouchBorder for the gesture navigation mode, but the gesture takes an unusable amount of distance to fully trigger. With this MR we can adapt the gesture distance to better fit the mobile usecase without changing behavior for desktop.

Old behavior:

gesture_pinephone_portrait

gesture_pinephone_landscape

In the portrait video you can see that for the gesture to fully activate, the finger needs to move up about 3/4 of the screen, on landscape this is even worse, where for the gesture to activate the full screen height is needed. In landscape you can also see how a partial activation just stops the gesture. (Note: the gesture overall is also a bit jitter-y, but this should be safe to ignore - I've not had the time yet to investigate its cause, but it is unaffected by this change)

If there is a better way to achieve this, I'd be happy for a pointer in the right direction, but the comment next to the original hardcoded distance sounds like other more screen-geometry-aware methods were used without much success:

const int maxDelta = 500; // Arbitrary logical pixels value seems to behave better than scaledScreenSize

This is a companion/prerequisite MR for a current draft on the Plasma Mobile side: plasma-mobile!454 (merged)

Merge request reports

Loading