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.
This commit is contained in:
xdavidwu 2021-09-13 20:32:30 +08:00
parent 671bb448a1
commit 871ee084be
No known key found for this signature in database
GPG key ID: EF1E781EE6BE877E

View file

@ -200,8 +200,8 @@ static void wl_pointer_button(void *data, struct wl_pointer *wl_pointer,
return; return;
} }
double x = seat->pointer.x * swaynag->scale; double x = seat->pointer.x;
double y = seat->pointer.y * swaynag->scale; double y = seat->pointer.y;
for (int i = 0; i < swaynag->buttons->length; i++) { for (int i = 0; i < swaynag->buttons->length; i++) {
struct swaynag_button *nagbutton = swaynag->buttons->items[i]; struct swaynag_button *nagbutton = swaynag->buttons->items[i];
if (x >= nagbutton->x if (x >= nagbutton->x