xwm: Reset wm->focus_window when the focused window is destroyed
diff --git a/src/xwayland/window-manager.c b/src/xwayland/window-manager.c
index 334b584..dbab20f 100644
--- a/src/xwayland/window-manager.c
+++ b/src/xwayland/window-manager.c
@@ -740,6 +740,9 @@
 	xcb_destroy_window(wm->conn, window->frame_id);
 	if (window->surface)
 		wl_list_remove(&window->surface_destroy_listener.link);
+	if (wm->focus_window == window)
+		wm->focus_window = NULL;
+
 	free(window);
 }