diff options
author | emersion <contact@emersion.fr> | 2017-11-12 12:38:08 +0100 |
---|---|---|
committer | emersion <contact@emersion.fr> | 2017-11-12 12:38:08 +0100 |
commit | 0b3f83d93adf23dcc0737928de355f555dd82dee (patch) | |
tree | 875a5eedbb47f5e89c5f43d7334bd0cfaec993ca /rootston/desktop.c | |
parent | c1eff3d3afc237aa4a988a01c88c492a4787d954 (diff) |
Fix pointer input for rotated views on HiDPI outputs
Diffstat (limited to 'rootston/desktop.c')
-rw-r--r-- | rootston/desktop.c | 7 |
1 files 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 |