From 1fdb1f79445ea6edc87900060443aaa8a2dcbc4d Mon Sep 17 00:00:00 2001 From: ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> Date: Thu, 8 Feb 2024 15:18:18 +0100 Subject: Improve Fl_Wayland_Window_Driver::hide() --- src/drivers/Wayland/Fl_Wayland_Window_Driver.cxx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/drivers') diff --git a/src/drivers/Wayland/Fl_Wayland_Window_Driver.cxx b/src/drivers/Wayland/Fl_Wayland_Window_Driver.cxx index 35c76e017..055802192 100644 --- a/src/drivers/Wayland/Fl_Wayland_Window_Driver.cxx +++ b/src/drivers/Wayland/Fl_Wayland_Window_Driver.cxx @@ -453,13 +453,15 @@ void Fl_Wayland_Window_Driver::hide() { Fl_Screen_Driver::del_transient_window(NULL); } Fl_X* ip = Fl_X::flx(pWindow); + if (!ip) return; + struct wld_window *wld_win = (struct wld_window*)ip->xid; + if (wld_win->custom_cursor) delete_cursor_(); if (hide_common()) return; if (ip->region) { Fl_Graphics_Driver::default_driver().XDestroyRegion(ip->region); ip->region = 0; } screen_num_ = -1; - struct wld_window *wld_win = (struct wld_window*)ip->xid; if (wld_win) { // this test makes sure ip->xid has not been destroyed already Fl_Wayland_Graphics_Driver::buffer_release(wld_win); if (wld_win->kind == SUBWINDOW && wld_win->subsurface) { @@ -489,7 +491,6 @@ void Fl_Wayland_Window_Driver::hide() { destroy_surface_caution_pointer_focus(wld_win->wl_surface, scr_driver->seat); wld_win->wl_surface = NULL; } - if (wld_win->custom_cursor) delete_cursor_(); while (!wl_list_empty(&wld_win->outputs)) { // remove from screens where it belongs struct surface_output *s_output; s_output = wl_container_of(wld_win->outputs.next, s_output, link); -- cgit v1.2.3