aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Kenny Levinsen <kl@kl.wtf>2021-03-18 15:23:23 +0100
committerLibravatar Kenny Levinsen <kl@kl.wtf>2021-03-20 11:56:13 +0100
commit6271bd06e940d1ef289804f9ea2a1e1bf65af559 (patch)
tree00a803d0e35808afeee3223935a4ff84d95c2fd6
parentswaybar: silence missing IconThemePath message (diff)
downloadsway-6271bd06e940d1ef289804f9ea2a1e1bf65af559.tar.gz
sway-6271bd06e940d1ef289804f9ea2a1e1bf65af559.tar.zst
sway-6271bd06e940d1ef289804f9ea2a1e1bf65af559.zip
swaybar: Use position from wl_pointer.enter
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: https://github.com/swaywm/sway/issues/6109
-rw-r--r--swaybar/input.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/swaybar/input.c b/swaybar/input.c
index 67f3522a..6e13f177 100644
--- a/swaybar/input.c
+++ b/swaybar/input.c
@@ -101,6 +101,8 @@ static void wl_pointer_enter(void *data, struct wl_pointer *wl_pointer,
101 wl_fixed_t surface_x, wl_fixed_t surface_y) { 101 wl_fixed_t surface_x, wl_fixed_t surface_y) {
102 struct swaybar_seat *seat = data; 102 struct swaybar_seat *seat = data;
103 struct swaybar_pointer *pointer = &seat->pointer; 103 struct swaybar_pointer *pointer = &seat->pointer;
104 seat->pointer.x = wl_fixed_to_double(surface_x);
105 seat->pointer.y = wl_fixed_to_double(surface_y);
104 pointer->serial = serial; 106 pointer->serial = serial;
105 struct swaybar_output *output; 107 struct swaybar_output *output;
106 wl_list_for_each(output, &seat->bar->outputs, link) { 108 wl_list_for_each(output, &seat->bar->outputs, link) {