From 212a89549cb300a428015650ec1fb29df9074386 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=A4in=C3=B6=20M=C3=A4kel=C3=A4?= Date: Fri, 29 Dec 2023 11:05:20 +0200 Subject: [PATCH] bar/wayland: Reset last_mapped_monitor on enter If the surface enters an output, there's no need for last_mapped_monitor, and it must be reset to fulfill the asserts in other parts of the code. This makes yambar no longer crash when it is hidden by an opaque window multiple times on a compositor using wlroots' scene tree. --- bar/wayland.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bar/wayland.c b/bar/wayland.c index e95e032..2b1e0a5 100644 --- a/bar/wayland.c +++ b/bar/wayland.c @@ -1339,6 +1339,9 @@ surface_enter(void *data, struct wl_surface *wl_surface, { struct wayland_backend *backend = data; + free(backend->last_mapped_monitor); + backend->last_mapped_monitor = NULL; + tll_foreach(backend->monitors, it) { struct monitor *mon = &it->item;