diff options
author | Drew DeVault <sir@cmpwn.com> | 2018-03-30 17:26:58 -0400 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2018-03-30 18:23:57 -0400 |
commit | e3eb487dc2c3ed51b974212ddb15ce839289eba2 (patch) | |
tree | cac47ecb69c8bfae810360064b308e91180d7e51 /rootston | |
parent | dc412c514b88d253dc86cf72a574530e12b7dcb7 (diff) |
Add pointer support to layer shell example
Diffstat (limited to 'rootston')
-rw-r--r-- | rootston/desktop.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/rootston/desktop.c b/rootston/desktop.c index aa06000c..45bf8105 100644 --- a/rootston/desktop.c +++ b/rootston/desktop.c @@ -669,12 +669,13 @@ static struct wlr_surface *layer_surface_at(struct roots_output *output, double _sx = ox - roots_surface->geo.x; double _sy = oy - roots_surface->geo.y; struct wlr_box box = { - .x = 0, .y = 0, - .width = roots_surface->geo.width, - .height = roots_surface->geo.height, + .x = roots_surface->geo.x, + .y = roots_surface->geo.y, + .width = wlr_surface->current->width, + .height = wlr_surface->current->height, }; // TODO: Test popups/subsurfaces - if (wlr_box_contains_point(&box, _sx, _sy) && + if (wlr_box_contains_point(&box, ox, oy) && pixman_region32_contains_point(&wlr_surface->current->input, _sx, _sy, NULL)) { *sx = _sx; @@ -692,7 +693,7 @@ struct wlr_surface *desktop_surface_at(struct roots_desktop *desktop, struct wlr_output *wlr_output = wlr_output_layout_output_at(desktop->layout, lx, ly); struct roots_output *roots_output; - double ox, oy; + double ox = lx, oy = ly; if (wlr_output) { roots_output = wlr_output->data; wlr_output_layout_output_coords(desktop->layout, wlr_output, &ox, &oy); |