diff options
author | Hristo Venev <hristo@venev.name> | 2020-02-01 18:58:13 +0100 |
---|---|---|
committer | Simon Ser <contact@emersion.fr> | 2020-02-10 18:58:09 +0100 |
commit | fca32b6334afe69ea10c88de7670c79ae98ce0fd (patch) | |
tree | 66ca6253e253da6029df2981659557439af709ed /swaybar | |
parent | Avoid calling strcmp on nullptr (diff) | |
download | sway-fca32b6334afe69ea10c88de7670c79ae98ce0fd.tar.gz sway-fca32b6334afe69ea10c88de7670c79ae98ce0fd.tar.zst sway-fca32b6334afe69ea10c88de7670c79ae98ce0fd.zip |
Do not truncate pointer coordinates to int.
This increases the precision of the clicks when using i3bar.
Diffstat (limited to 'swaybar')
-rw-r--r-- | swaybar/input.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/swaybar/input.c b/swaybar/input.c index 7f68caec..aa6290fa 100644 --- a/swaybar/input.c +++ b/swaybar/input.c | |||
@@ -121,8 +121,8 @@ static void wl_pointer_leave(void *data, struct wl_pointer *wl_pointer, | |||
121 | static void wl_pointer_motion(void *data, struct wl_pointer *wl_pointer, | 121 | static void wl_pointer_motion(void *data, struct wl_pointer *wl_pointer, |
122 | uint32_t time, wl_fixed_t surface_x, wl_fixed_t surface_y) { | 122 | uint32_t time, wl_fixed_t surface_x, wl_fixed_t surface_y) { |
123 | struct swaybar_seat *seat = data; | 123 | struct swaybar_seat *seat = data; |
124 | seat->pointer.x = wl_fixed_to_int(surface_x); | 124 | seat->pointer.x = wl_fixed_to_double(surface_x); |
125 | seat->pointer.y = wl_fixed_to_int(surface_y); | 125 | seat->pointer.y = wl_fixed_to_double(surface_y); |
126 | } | 126 | } |
127 | 127 | ||
128 | static bool check_bindings(struct swaybar *bar, uint32_t button, | 128 | static bool check_bindings(struct swaybar *bar, uint32_t button, |