diff options
-rw-r--r-- | clients/xwm.c | 3 | ||||
-rw-r--r-- | src/xwayland/window-manager.c | 10 |
2 files changed, 10 insertions, 3 deletions
diff --git a/clients/xwm.c b/clients/xwm.c index edd7037..ecad4a2 100644 --- a/clients/xwm.c +++ b/clients/xwm.c @@ -148,6 +148,7 @@ task_window_destroy(struct task *task, uint32_t events) fprintf(stderr, "%s: implementation fail\n", __func__); hash_table_remove(window->wm->window_hash, window->id); + wm_xwin_destroy(window->xwin); free(window); window = NULL; } @@ -795,12 +796,12 @@ xwm_handle_unmap_notify(struct xwm_wm *wm, xcb_generic_event_t *event) xcb_destroy_window(wm->conn, window->frame_id); xwm_window_set_state(window, ICCCM_WITHDRAWN_STATE); hash_table_remove(wm->window_hash, window->frame_id); + wm_xwin_destroy(window->xwin_frame); window->frame_id = XCB_WINDOW_NONE; } if (wm->focus_window == window) wm->focus_window = NULL; - /*TODO: need to send a message to remove the window on compositor */ } static void diff --git a/src/xwayland/window-manager.c b/src/xwayland/window-manager.c index ccb8c4e..4a22ffa 100644 --- a/src/xwayland/window-manager.c +++ b/src/xwayland/window-manager.c @@ -62,7 +62,8 @@ surface_destroy(struct wl_listener *listener, void *data) window->shsurf = NULL; window->pending_opaque = NULL; - fprintf(stderr, "surface for xid %d destroyed\n", window->xid); + window->surface_destroy_listener.notify= NULL; + wl_list_remove(&window->surface_destroy_listener.link); } static struct xserver_window * @@ -270,9 +271,14 @@ wm_destroy_xwin(struct wl_resource *resource) { struct xserver_window *window = resource->data; + if (window->surface_destroy_listener.notify == surface_destroy) + surface_destroy(&window->surface_destroy_listener, NULL); + + wl_list_remove(&window->kill_listener.link); + wl_list_remove(&window->position_listener.link); wl_list_remove(&window->link); - window = NULL; free(window); + window = NULL; } static void |