summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTiago Vignatti <tiago.vignatti@intel.com>2012-12-28 13:14:08 -0200
committerTiago Vignatti <tiago.vignatti@intel.com>2012-12-28 14:26:46 -0200
commit110daf4e9a36fd0a0f033a362d97d760a9f23a8c (patch)
tree8588ce5f9a42c269b7d4cf54535b95aff737cdea
parenta7a5ac3ffb8f34a3f11a12018bfeeece56e16ba3 (diff)
xwayland: Destroy xwin resources after usedxwm-client
Signed-off-by: Tiago Vignatti <tiago.vignatti@intel.com>
-rw-r--r--clients/xwm.c3
-rw-r--r--src/xwayland/window-manager.c10
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