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.
This commit is contained in:
Väinö Mäkelä 2023-12-29 11:05:20 +02:00
parent 89e74139f5
commit 212a89549c

View file

@ -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;