summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2023-03-20 10:39:55 +0100
committerManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2023-03-20 10:39:55 +0100
commit41c94c4d87f47afcf4b772f8c428a7b092eb34b8 (patch)
treeb6b0c4aae8853c1c001a4803c61fa04cccd54220 /src
parentad3ead111aadf25e11528d3daf81c0ebbdaa94f8 (diff)
Wayland: attempt to improve registry_handle_global_remove()
This function still needs to be tested on a true multi-display Unix box
Diffstat (limited to 'src')
-rw-r--r--src/drivers/Wayland/Fl_Wayland_Screen_Driver.cxx8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/drivers/Wayland/Fl_Wayland_Screen_Driver.cxx b/src/drivers/Wayland/Fl_Wayland_Screen_Driver.cxx
index 06248bf07..7f0d7f8cd 100644
--- a/src/drivers/Wayland/Fl_Wayland_Screen_Driver.cxx
+++ b/src/drivers/Wayland/Fl_Wayland_Screen_Driver.cxx
@@ -1101,16 +1101,18 @@ static void registry_handle_global(void *user_data, struct wl_registry *wl_regis
static void registry_handle_global_remove(void *data, struct wl_registry *registry, uint32_t name)
{//TODO to be tested
- Fl_Wayland_Screen_Driver::output *output;
+ Fl_Wayland_Screen_Driver::output *output, *tmp;
//fprintf(stderr, "registry_handle_global_remove data=%p id=%u\n", data, name);
Fl_Wayland_Screen_Driver *scr_driver = (Fl_Wayland_Screen_Driver*)Fl::screen_driver();
- wl_list_for_each(output, &(scr_driver->outputs), link) { // all screens of the system
+ wl_list_for_each_safe(output, tmp, &(scr_driver->outputs), link) { // all screens of the system
if (output->id == name) { // the screen being removed
+ again:
Fl_X *xp = Fl_X::first;
while (xp) { // all mapped windows
struct wld_window *win = (struct wld_window*)xp->xid;
if (win->output == output) {
- win->output = NULL;
+ delete win->fl_win;
+ goto again;
}
xp = xp->next;
}