Skip to content

Commit ff9169c

Browse files
committed
Scale wayland input coordinates
1 parent 6fa62cc commit ff9169c

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/wayland/wl_seat.c

+5-2
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,10 @@ static void touch_handle_up(void *data, struct wl_touch *wl_touch,
5050
if (id >= MAX_TOUCHPOINTS) {
5151
return;
5252
}
53+
54+
double scale = wl_get_scale();
5355
input_handle_click(BTN_TOUCH, false,
54-
seat->touch.pts[id].x, seat->touch.pts[id].y);
56+
seat->touch.pts[id].x/scale, seat->touch.pts[id].y/scale);
5557

5658
}
5759

@@ -100,7 +102,8 @@ static void pointer_handle_button(void *data, struct wl_pointer *wl_pointer,
100102
uint32_t button_state) {
101103
struct dunst_seat *seat = data;
102104

103-
input_handle_click(button, button_state, seat->pointer.x, seat->pointer.y);
105+
double scale = wl_get_scale();
106+
input_handle_click(button, button_state, seat->pointer.x/scale, seat->pointer.y/scale);
104107
}
105108

106109
static void pointer_handle_leave(void *data, struct wl_pointer *wl_pointer,

0 commit comments

Comments
 (0)