diff options
author | Drew DeVault <[email protected]> | 2019-07-05 14:45:11 -0400 |
---|---|---|
committer | Simon Ser <[email protected]> | 2019-08-14 22:10:05 +0300 |
commit | cb8f68d74b6c9f0b9690c44a34b8a8f1c46986be (patch) | |
tree | a49f7022c65a5a11f6fbdb4c164ac3a4c9b3c2cd /sway/desktop/output.c | |
parent | f36240208c57124a88cdee18fb81fa3fc69e0f0a (diff) |
layer-shell: add support for popups
Diffstat (limited to 'sway/desktop/output.c')
-rw-r--r-- | sway/desktop/output.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/sway/desktop/output.c b/sway/desktop/output.c index 7dcc8e51..1f3cc938 100644 --- a/sway/desktop/output.c +++ b/sway/desktop/output.c @@ -204,6 +204,36 @@ void output_layer_for_each_surface(struct sway_output *output, output_surface_for_each_surface(output, wlr_layer_surface_v1->surface, layer_surface->geo.x, layer_surface->geo.y, iterator, user_data); + + struct wlr_xdg_popup *state; + wl_list_for_each(state, &wlr_layer_surface_v1->popups, link) { + struct wlr_xdg_surface *popup = state->base; + if (!popup->configured) { + continue; + } + + double popup_sx, popup_sy; + popup_sx = layer_surface->geo.x + + popup->popup->geometry.x - popup->geometry.x; + popup_sy = layer_surface->geo.y + + popup->popup->geometry.y - popup->geometry.y; + + struct wlr_surface *surface = popup->surface; + + struct surface_iterator_data data = { + .user_iterator = iterator, + .user_data = user_data, + .output = output, + .ox = popup_sx, + .oy = popup_sy, + .width = surface->current.width, + .height = surface->current.height, + .rotation = 0, + }; + + wlr_xdg_surface_for_each_surface( + popup, output_for_each_surface_iterator, &data); + } } } |