sway/swaybar
Michael Weiser d4482400f1 swaybar: Implement pointer gesture swipe support
After previous commits, swaybar bindsym statements would already accept
the new pseudo button names for swipe gestures. Also, sway itself would
not handle swipes when executed while the pointer was above a bar.

Add the necessary handling for three- and four-finger swipe pointer
gestures in swaybar. Cancel ongoing swipes when the pointer leaves the
bar as to not confuse successive swipes with focus changes inbetween
them.  Add the pointer gestures protocol in client and server variants
to the meson build file to make the necessary definitions available.
Bind to the global interface on startup, instantiate a swipe gesture and
add a listener on seat setup as well as destroy it on seat shutdown.

Extend the sway-bar manual page as necessary.

Test-plan:
- add workspace switching to config like so:

bar bar-0 {
        swaybar_command swaybar

        bindsym release SWIPE_3_LEFT workspace prev_on_output
        bindsym release SWIPE_4_RIGHT workspace next_on_output
        bindsym --release SWIPE_3_LEFT exec yad --text foo
        bindsym --release SWIPE_4_UP exec yad --text bar
}

- start sway and open two workspaces
- position pointer above a bar surface
- switch back and forth using horizontal three- and four-finger swipes,
  observing that different finger counts are necessary per direction
- observe that the --release binding for left swipes is ignored because
  there is an on-press binding already
- observe that the --release binding for upward swipes is honoured
  because there is no on-press binding
- move pointer away from bar surface
- observe that switching by swipe no longer works

Signed-off-by: Michael Weiser <michael.weiser@gmx.de>
2021-08-05 20:10:07 +02:00
..
tray cairo: Replace <cairo/cairo.h> by <cairo.h> 2021-05-10 10:28:32 +02:00
bar.c swaybar: Implement pointer gesture swipe support 2021-08-05 20:10:07 +02:00
config.c Add support for workspace_min_width bar option. 2020-10-11 19:12:42 +02:00
i3bar.c swaybar: fix i3bar relative coordinates when scaling is used 2020-02-10 18:58:09 +01:00
input.c swaybar: Implement pointer gesture swipe support 2021-08-05 20:10:07 +02:00
ipc.c swaybar: fail gracefully on tokener creation fail 2021-03-22 14:10:53 +01:00
main.c Make command line option lists const 2021-02-04 09:49:06 +01:00
meson.build build: introduce sd-bus-provider option 2020-12-09 17:39:20 -05:00
render.c cairo: Replace <cairo/cairo.h> by <cairo.h> 2021-05-10 10:28:32 +02:00
status_line.c swaybar: allow status line cleanup to proceed when hidden 2020-07-22 09:40:37 +02:00
swaybar-protocol.7.scd man: update maintainer 2021-01-08 09:33:51 +01:00