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 committed by Daniel Eklöf
parent 60671da2ca
commit 1283160e17
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F

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;