aboutsummaryrefslogtreecommitdiff
path: root/rootston/desktop.c
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2018-04-23 13:00:57 +0200
committerGitHub <noreply@github.com>2018-04-23 13:00:57 +0200
commite2ed7be0baa6fe17d6a4a73c68ac1e8b6dea96f9 (patch)
tree101646e1bb387610b1e29f24427ea4bd01fd546f /rootston/desktop.c
parentda944cccb3b118f01a5e8a5406c328ddb75822d7 (diff)
parent32e043f996d00428731e9d97f8e45180574681b1 (diff)
Merge pull request #877 from agx/layer-popups
Layer popups: work on top of PR 867
Diffstat (limited to 'rootston/desktop.c')
-rw-r--r--rootston/desktop.c23
1 files changed, 18 insertions, 5 deletions
diff --git a/rootston/desktop.c b/rootston/desktop.c
index 0949b5db..6ac665bc 100644
--- a/rootston/desktop.c
+++ b/rootston/desktop.c
@@ -641,11 +641,24 @@ 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 =
- roots_surface->layer_surface->surface;
- double _sx = ox - roots_surface->geo.x;
- double _sy = oy - roots_surface->geo.y;
- // TODO: Test popups/subsurfaces
+ 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;