diff options
author | Drew DeVault <sir@cmpwn.com> | 2018-05-08 10:22:22 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-05-08 10:22:22 -0400 |
commit | 397ee7ff9db37d92c48541ff680ec896f335c06b (patch) | |
tree | 78b5017efe60245e1dc378071424db7b4f95157a /rootston/desktop.c | |
parent | 7c2241a55658468fbbeec5cc544e377ad0bccb58 (diff) | |
parent | 8931452e1d653cb2cf20b0b0a9892cfc11b24af9 (diff) |
Merge pull request #962 from Ongy/layer-surface-at
add wlr_layer_surface_surface_at
Diffstat (limited to 'rootston/desktop.c')
-rw-r--r-- | rootston/desktop.c | 31 |
1 files changed, 9 insertions, 22 deletions
diff --git a/rootston/desktop.c b/rootston/desktop.c index 6ac665bc..192c7da0 100644 --- a/rootston/desktop.c +++ b/rootston/desktop.c @@ -641,30 +641,17 @@ static struct wlr_surface *layer_surface_at(struct roots_output *output, struct wl_list *layer, double ox, double oy, double *sx, double *sy) { struct roots_layer_surface *roots_surface; wl_list_for_each_reverse(roots_surface, layer, link) { - struct wlr_surface *wlr_surface; - double _sx, _sy; - struct wlr_xdg_popup *popup; - wl_list_for_each(popup, &roots_surface->layer_surface->popups, link) { - wlr_surface = popup->base->surface; - _sx = ox - roots_surface->geo.x - popup->geometry.x; - _sy = oy - roots_surface->geo.y - popup->geometry.y; - if (wlr_surface_point_accepts_input(wlr_surface, _sx, _sy)) { - *sx = _sx; - *sy = _sy; - return wlr_surface; - } - // TODO: popups can have popups - } - // TODO: Test subsurfaces - wlr_surface = roots_surface->layer_surface->surface; - _sx = ox - roots_surface->geo.x; - _sy = oy - roots_surface->geo.y; - if (wlr_surface_point_accepts_input(wlr_surface, _sx, _sy)) { - *sx = _sx; - *sy = _sy; - return wlr_surface; + double _sx = ox - roots_surface->geo.x; + double _sy = oy - roots_surface->geo.y; + + struct wlr_surface *sub = wlr_layer_surface_surface_at( + roots_surface->layer_surface, _sx, _sy, sx, sy); + + if (sub) { + return sub; } } + return NULL; } |