diff options
author | Drew DeVault <sir@cmpwn.com> | 2017-10-25 22:46:20 -0400 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2017-11-01 08:51:59 -0400 |
commit | bafb97087121dbeab83ffc7d2e571d4c53d1f000 (patch) | |
tree | 6f2823cd8a224a10576582dd2a84230a763b71d6 /rootston/desktop.c | |
parent | a6930cd8ea2424f12aafc8d0b67426d0e5161c44 (diff) |
View view_at (and pointer events) for hidpi
Diffstat (limited to 'rootston/desktop.c')
-rw-r--r-- | rootston/desktop.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/rootston/desktop.c b/rootston/desktop.c index 0cc2180d..f7f12eff 100644 --- a/rootston/desktop.c +++ b/rootston/desktop.c @@ -61,11 +61,9 @@ static void view_update_output(const struct roots_view *view, desktop->layout, output->wlr_output, view->x, view->y, view->x + box.width, view->y + box.height); if (intersected && !intersects) { - wlr_log(L_DEBUG, "Leaving output %s", output->wlr_output->name); wlr_surface_send_leave(view->wlr_surface, output->wlr_output); } if (!intersected && intersects) { - wlr_log(L_DEBUG, "Entering output %s", output->wlr_output->name); wlr_surface_send_enter(view->wlr_surface, output->wlr_output); } } @@ -167,14 +165,15 @@ struct roots_view *view_at(struct roots_desktop *desktop, double lx, double ly, continue; } - double view_sx = lx - view->x; - double view_sy = ly - view->y; + int scale = view->wlr_surface->current->scale; + double view_sx = (lx - view->x) / (double)scale; + double view_sy = (ly - view->y) / (double)scale; struct wlr_box box = { .x = 0, .y = 0, - .width = view->wlr_surface->current->buffer_width, - .height = view->wlr_surface->current->buffer_height, + .width = view->wlr_surface->current->buffer_width * scale, + .height = view->wlr_surface->current->buffer_height * scale, }; if (view->rotation != 0.0) { // Coordinates relative to the center of the view |