summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKristian Høgsberg <krh@bitplanet.net>2012-06-05 11:46:08 -0400
committerKristian Høgsberg <krh@bitplanet.net>2012-06-05 11:46:08 -0400
commitbe375b362b8128034ad41178b393bccf797c1728 (patch)
tree4b0dac1029cde82ddce3a4cfa3fc103dd31e322e
parent9892a62b4590e9e636d4ac1493e414838064862c (diff)
xwm: Only destroy window frame in unmap_notify if we have one
Based on a patch from Tiago Vignatti <tiago.vignatti@intel.com>.
-rw-r--r--src/xwayland/window-manager.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/xwayland/window-manager.c b/src/xwayland/window-manager.c
index 0a31a65..3094601 100644
--- a/src/xwayland/window-manager.c
+++ b/src/xwayland/window-manager.c
@@ -573,14 +573,16 @@ weston_wm_handle_unmap_notify(struct weston_wm *wm, xcb_generic_event_t *event)
if (window->cairo_surface)
cairo_surface_destroy(window->cairo_surface);
- xcb_reparent_window(wm->conn, window->id, wm->wm_window, 0, 0);
- xcb_destroy_window(wm->conn, window->frame_id);
- weston_wm_window_set_state(window, ICCCM_WITHDRAWN_STATE);
+ if (window->frame_id) {
+ xcb_reparent_window(wm->conn, window->id, wm->wm_window, 0, 0);
+ xcb_destroy_window(wm->conn, window->frame_id);
+ weston_wm_window_set_state(window, ICCCM_WITHDRAWN_STATE);
+ hash_table_remove(wm->window_hash, window->frame_id);
+ window->frame_id = XCB_WINDOW_NONE;
+ }
- window->frame_id = XCB_WINDOW_NONE;
if (wm->focus_window == window)
wm->focus_window = NULL;
- hash_table_remove(wm->window_hash, window->frame_id);
if (window->surface)
wl_list_remove(&window->surface_destroy_listener.link);
window->surface = NULL;