Skip to content

Commit

Permalink
swaybar: Use position from wl_pointer.enter
Browse files Browse the repository at this point in the history
Only wl_pointer.motion was used to update pointer position, which would
cause issues if the pointer was not moved prior to wl_pointer.button.

This also fixes touch input through wl_pointer emulation, which fires
wl_pointer.button immediately after wl_pointer.enter.

Copied from a similar fix made to swaynag.

Closes: swaywm#6109
(cherry picked from commit 6271bd0)
  • Loading branch information
kennylevinsen authored and emersion committed Mar 24, 2021
1 parent ec8d6d7 commit c517874
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions swaybar/input.c
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,8 @@ static void wl_pointer_enter(void *data, struct wl_pointer *wl_pointer,
wl_fixed_t surface_x, wl_fixed_t surface_y) {
struct swaybar_seat *seat = data;
struct swaybar_pointer *pointer = &seat->pointer;
seat->pointer.x = wl_fixed_to_double(surface_x);
seat->pointer.y = wl_fixed_to_double(surface_y);
pointer->serial = serial;
struct swaybar_output *output;
wl_list_for_each(output, &seat->bar->outputs, link) {
Expand Down

0 comments on commit c517874

Please sign in to comment.