diff options
author | David96 <david@hameipe.de> | 2019-12-03 16:03:38 +0100 |
---|---|---|
committer | Simon Ser <contact@emersion.fr> | 2020-04-10 10:45:47 +0200 |
commit | 8c6227820754f2bb09ebda3676dcf7a43722ff64 (patch) | |
tree | 63e68c2e9f78d44287f7a451e57c93d1872a5551 /sway/desktop/output.c | |
parent | output: remove damage listeners in damage destroy (diff) | |
download | sway-8c6227820754f2bb09ebda3676dcf7a43722ff64.tar.gz sway-8c6227820754f2bb09ebda3676dcf7a43722ff64.tar.zst sway-8c6227820754f2bb09ebda3676dcf7a43722ff64.zip |
Render layer shell popups over the top layer
Diffstat (limited to 'sway/desktop/output.c')
-rw-r--r-- | sway/desktop/output.c | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/sway/desktop/output.c b/sway/desktop/output.c index 367be2d0..a86622e1 100644 --- a/sway/desktop/output.c +++ b/sway/desktop/output.c | |||
@@ -243,6 +243,61 @@ void output_layer_for_each_surface(struct sway_output *output, | |||
243 | } | 243 | } |
244 | } | 244 | } |
245 | 245 | ||
246 | void output_layer_for_each_surface_toplevel(struct sway_output *output, | ||
247 | struct wl_list *layer_surfaces, sway_surface_iterator_func_t iterator, | ||
248 | void *user_data) { | ||
249 | struct sway_layer_surface *layer_surface; | ||
250 | wl_list_for_each(layer_surface, layer_surfaces, link) { | ||
251 | struct wlr_layer_surface_v1 *wlr_layer_surface_v1 = | ||
252 | layer_surface->layer_surface; | ||
253 | output_surface_for_each_surface(output, wlr_layer_surface_v1->surface, | ||
254 | layer_surface->geo.x, layer_surface->geo.y, iterator, | ||
255 | user_data); | ||
256 | } | ||
257 | } | ||
258 | |||
259 | |||
260 | void output_layer_for_each_surface_popup(struct sway_output *output, | ||
261 | struct wl_list *layer_surfaces, sway_surface_iterator_func_t iterator, | ||
262 | void *user_data) { | ||
263 | struct sway_layer_surface *layer_surface; | ||
264 | wl_list_for_each(layer_surface, layer_surfaces, link) { | ||
265 | struct wlr_layer_surface_v1 *wlr_layer_surface_v1 = | ||
266 | layer_surface->layer_surface; | ||
267 | |||
268 | struct wlr_xdg_popup *state; | ||
269 | wl_list_for_each(state, &wlr_layer_surface_v1->popups, link) { | ||
270 | struct wlr_xdg_surface *popup = state->base; | ||
271 | if (!popup->configured) { | ||
272 | continue; | ||
273 | } | ||
274 | |||
275 | double popup_sx, popup_sy; | ||
276 | popup_sx = layer_surface->geo.x + | ||
277 | popup->popup->geometry.x - popup->geometry.x; | ||
278 | popup_sy = layer_surface->geo.y + | ||
279 | popup->popup->geometry.y - popup->geometry.y; | ||
280 | |||
281 | struct wlr_surface *surface = popup->surface; | ||
282 | |||
283 | struct surface_iterator_data data = { | ||
284 | .user_iterator = iterator, | ||
285 | .user_data = user_data, | ||
286 | .output = output, | ||
287 | .view = NULL, | ||
288 | .ox = popup_sx, | ||
289 | .oy = popup_sy, | ||
290 | .width = surface->current.width, | ||
291 | .height = surface->current.height, | ||
292 | .rotation = 0, | ||
293 | }; | ||
294 | |||
295 | wlr_xdg_surface_for_each_surface( | ||
296 | popup, output_for_each_surface_iterator, &data); | ||
297 | } | ||
298 | } | ||
299 | } | ||
300 | |||
246 | #if HAVE_XWAYLAND | 301 | #if HAVE_XWAYLAND |
247 | void output_unmanaged_for_each_surface(struct sway_output *output, | 302 | void output_unmanaged_for_each_surface(struct sway_output *output, |
248 | struct wl_list *unmanaged, sway_surface_iterator_func_t iterator, | 303 | struct wl_list *unmanaged, sway_surface_iterator_func_t iterator, |