aboutsummaryrefslogtreecommitdiffstats
path: root/swaynag/swaynag.c
diff options
context:
space:
mode:
authorLibravatar xdavidwu <xdavidwuph@gmail.com>2021-09-13 20:32:30 +0800
committerLibravatar Simon Ser <contact@emersion.fr>2021-09-13 14:46:01 +0200
commit806b59eca3eecfeca15d71967a0bf6438641f332 (patch)
treef60dea4258264845cc92d04d2ff9b850ab2442d6 /swaynag/swaynag.c
parentRename pango_printf to render_text (diff)
downloadsway-806b59eca3eecfeca15d71967a0bf6438641f332.tar.gz
sway-806b59eca3eecfeca15d71967a0bf6438641f332.tar.zst
sway-806b59eca3eecfeca15d71967a0bf6438641f332.zip
swaynag: fix pointer button events on scaled outputs
sway#6504 simplified rendering code by setting scaling at cairo, but that also changed button position records into ones without scale multiplication, breaking button events. This fixes it by not multiplying scale on events handling as well.
Diffstat (limited to 'swaynag/swaynag.c')
-rw-r--r--swaynag/swaynag.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/swaynag/swaynag.c b/swaynag/swaynag.c
index dd17c0b0..6d4a7a58 100644
--- a/swaynag/swaynag.c
+++ b/swaynag/swaynag.c
@@ -200,8 +200,8 @@ static void wl_pointer_button(void *data, struct wl_pointer *wl_pointer,
200 return; 200 return;
201 } 201 }
202 202
203 double x = seat->pointer.x * swaynag->scale; 203 double x = seat->pointer.x;
204 double y = seat->pointer.y * swaynag->scale; 204 double y = seat->pointer.y;
205 for (int i = 0; i < swaynag->buttons->length; i++) { 205 for (int i = 0; i < swaynag->buttons->length; i++) {
206 struct swaynag_button *nagbutton = swaynag->buttons->items[i]; 206 struct swaynag_button *nagbutton = swaynag->buttons->items[i];
207 if (x >= nagbutton->x 207 if (x >= nagbutton->x