]> git.mdlowis.com Git - proto/labwc.git/commitdiff
fix crash when a minimized window closes
authorbi4k8 <bi4k8@github>
Sat, 11 Dec 2021 23:24:44 +0000 (23:24 +0000)
committerARDiDo <90479315+ARDiDo@users.noreply.github.com>
Mon, 13 Dec 2021 00:03:03 +0000 (19:03 -0500)
e.g., open an editor from a terminal, minimize it, then hit ^C in the terminal

simply don't unmap xdg or xwayland views if they are not currently marked as mapped

src/xdg.c
src/xwayland.c

index f867216f1ce511cb53cfa640eddaffd1c2b2ad6a..e9960bc03c50ee189237d58c1c0c1a5b3ab10339 100644 (file)
--- a/src/xdg.c
+++ b/src/xdg.c
@@ -364,11 +364,13 @@ xdg_toplevel_view_map(struct view *view)
 static void
 xdg_toplevel_view_unmap(struct view *view)
 {
-       view->mapped = false;
-       damage_all_outputs(view->server);
-       wl_list_remove(&view->commit.link);
-       wl_list_remove(&view->new_subsurface.link);
-       desktop_focus_topmost_mapped_view(view->server);
+       if (view->mapped) {
+               view->mapped = false;
+               damage_all_outputs(view->server);
+               wl_list_remove(&view->commit.link);
+               wl_list_remove(&view->new_subsurface.link);
+               desktop_focus_topmost_mapped_view(view->server);
+       }
 }
 
 static const struct view_impl xdg_toplevel_view_impl = {
index 10f7d022f7afca77ea46bd4f9df6ce7e59bd0d50..44205a1f53b8545b8888162d6125f92ab0aebb7b 100644 (file)
@@ -279,10 +279,12 @@ map(struct view *view)
 static void
 unmap(struct view *view)
 {
-       view->mapped = false;
-       damage_all_outputs(view->server);
-       wl_list_remove(&view->commit.link);
-       desktop_focus_topmost_mapped_view(view->server);
+       if(view->mapped) {
+               view->mapped = false;
+               damage_all_outputs(view->server);
+               wl_list_remove(&view->commit.link);
+               desktop_focus_topmost_mapped_view(view->server);
+       }
 }
 
 static void