diff --git a/src/xdg.c b/src/xdg.c index f867216f..e9960bc0 100644 --- 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 = { diff --git a/src/xwayland.c b/src/xwayland.c index 10f7d022..44205a1f 100644 --- a/src/xwayland.c +++ b/src/xwayland.c @@ -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