aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Ser <contact@emersion.fr>2024-02-20 11:04:46 +0100
committerSimon Ser <contact@emersion.fr>2024-02-20 11:04:46 +0100
commit431e8a7fd7d459d740e14f3ad9fd7a6aab62eeb8 (patch)
treeb9d5cd22e5c14c5ce47ac894c6c1f6837ebe6c64
parent842093bb843ae6c719c2b1cf32eb749cab9e46ca (diff)
scene: ignore duplicate wlr_scene_output_layout_add_output() calls
An assert was added in [1] to avoid tracking the same output multiple times. However, this is cumbersome for compositors [2]: they need to add a special check for this. Additionally, this is inconsistent with wlr_output_layout_add(). [1]: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/4380 [2]: https://github.com/cage-kiosk/cage/pull/315
-rw-r--r--types/scene/output_layout.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/types/scene/output_layout.c b/types/scene/output_layout.c
index 42683f88..88185904 100644
--- a/types/scene/output_layout.c
+++ b/types/scene/output_layout.c
@@ -75,7 +75,9 @@ void wlr_scene_output_layout_add_output(struct wlr_scene_output_layout *sol,
struct wlr_scene_output_layout_output *solo;
wl_list_for_each(solo, &sol->outputs, link) {
- assert(solo->scene_output != so);
+ if (solo->scene_output == so) {
+ return;
+ }
}
solo = calloc(1, sizeof(*solo));