aboutsummaryrefslogtreecommitdiffstats
path: root/sway/desktop/output.c
diff options
context:
space:
mode:
Diffstat (limited to 'sway/desktop/output.c')
-rw-r--r--sway/desktop/output.c55
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
246void 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
260void 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
247void output_unmanaged_for_each_surface(struct sway_output *output, 302void 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,