From 0b3f83d93adf23dcc0737928de355f555dd82dee Mon Sep 17 00:00:00 2001 From: emersion Date: Sun, 12 Nov 2017 12:38:08 +0100 Subject: Fix pointer input for rotated views on HiDPI outputs --- rootston/desktop.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/rootston/desktop.c b/rootston/desktop.c index 448171ec..dcf36ecf 100644 --- a/rootston/desktop.c +++ b/rootston/desktop.c @@ -216,7 +216,7 @@ void view_teardown(struct roots_view *view) { struct roots_view *view_at(struct roots_desktop *desktop, double lx, double ly, struct wlr_surface **surface, double *sx, double *sy) { - for (int i = desktop->views->length - 1; i >= 0; --i) { + for (ssize_t i = desktop->views->length - 1; i >= 0; --i) { struct roots_view *view = desktop->views->items[i]; if (view->type == ROOTS_WL_SHELL_VIEW && @@ -228,11 +228,12 @@ struct roots_view *view_at(struct roots_desktop *desktop, double lx, double ly, double view_sx = lx - view->x; double view_sy = ly - view->y; + struct wlr_surface_state *state = view->wlr_surface->current; struct wlr_box box = { .x = 0, .y = 0, - .width = view->wlr_surface->current->buffer_width, - .height = view->wlr_surface->current->buffer_height, + .width = state->buffer_width / state->scale, + .height = state->buffer_height / state->scale, }; if (view->rotation != 0.0) { // Coordinates relative to the center of the view -- cgit v1.2.3