diff options
author | Drew DeVault <sir@cmpwn.com> | 2019-07-05 14:45:11 -0400 |
---|---|---|
committer | Simon Ser <contact@emersion.fr> | 2019-08-14 22:10:05 +0300 |
commit | cb8f68d74b6c9f0b9690c44a34b8a8f1c46986be (patch) | |
tree | a49f7022c65a5a11f6fbdb4c164ac3a4c9b3c2cd /sway/desktop/output.c | |
parent | workspace_split: focus middle if workspace focused (diff) | |
download | sway-cb8f68d74b6c9f0b9690c44a34b8a8f1c46986be.tar.gz sway-cb8f68d74b6c9f0b9690c44a34b8a8f1c46986be.tar.zst sway-cb8f68d74b6c9f0b9690c44a34b8a8f1c46986be.zip |
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, | |||
204 | output_surface_for_each_surface(output, wlr_layer_surface_v1->surface, | 204 | output_surface_for_each_surface(output, wlr_layer_surface_v1->surface, |
205 | layer_surface->geo.x, layer_surface->geo.y, iterator, | 205 | layer_surface->geo.x, layer_surface->geo.y, iterator, |
206 | user_data); | 206 | user_data); |
207 | |||
208 | struct wlr_xdg_popup *state; | ||
209 | wl_list_for_each(state, &wlr_layer_surface_v1->popups, link) { | ||
210 | struct wlr_xdg_surface *popup = state->base; | ||
211 | if (!popup->configured) { | ||
212 | continue; | ||
213 | } | ||
214 | |||
215 | double popup_sx, popup_sy; | ||
216 | popup_sx = layer_surface->geo.x + | ||
217 | popup->popup->geometry.x - popup->geometry.x; | ||
218 | popup_sy = layer_surface->geo.y + | ||
219 | popup->popup->geometry.y - popup->geometry.y; | ||
220 | |||
221 | struct wlr_surface *surface = popup->surface; | ||
222 | |||
223 | struct surface_iterator_data data = { | ||
224 | .user_iterator = iterator, | ||
225 | .user_data = user_data, | ||
226 | .output = output, | ||
227 | .ox = popup_sx, | ||
228 | .oy = popup_sy, | ||
229 | .width = surface->current.width, | ||
230 | .height = surface->current.height, | ||
231 | .rotation = 0, | ||
232 | }; | ||
233 | |||
234 | wlr_xdg_surface_for_each_surface( | ||
235 | popup, output_for_each_surface_iterator, &data); | ||
236 | } | ||
207 | } | 237 | } |
208 | } | 238 | } |
209 | 239 | ||