Skip to content

Pressure barrier for auto-hiding panels (X11 only)

Kirill Zhumarin requested to merge zhumarin/latte-dock:pressure-barrier into master

Latte Dock is awesome. But the current opening behavior for auto-hiding panels is slightly bad:

  • The panel opening by mouse swipe is too sensitive. There are lots of random panel openings in cases when the mouse accidentally touches the edge of the screen.
  • Show/Hide timeout doesn't help. Yes, timeout for the showing can reduce the number of false positives, but at the cost of longer access to the panel. But opening time is very critical for auto-hiding panels.

In Unity/GNOME, this problem is resolved differently - the panel opens via a "pressure" threshold.

They use a PressureBarrier which tracks the vector/velocity of the mouse swipe and calculates virtual "pressure" on the screen edge. The panel opens only when pressure reaches some threshold.

Main achievements with the pressure barrier:

  • We can immediately open the panel - by a fast mouse swipe.
  • We can access any content on the screen edge without false openings by "normal" mouse movings.
  • It is possible to use auto-hiding panels in multiscreen environments, where panels are placed at the border between two monitors.

This MR is a porting `PressureBarrier` from GNOME to the Latte Dock.

Implemented:

  • Settings: enable/disable, timeout (ms), threshold (px).
  • Optional PressureBarrier which works in AutoHide/DodgeActive/DodgeMaximized/DodgeAllWindows modes and Top/Left/Right/Bottom positions.

image.png

Edited by Kirill Zhumarin

Merge request reports