From 7dd3136915fa85ef913ebd5db3fdefc0e4208fa2 Mon Sep 17 00:00:00 2001 From: Vincent Povirk Date: Thu, 28 Feb 2008 22:07:38 -0500 Subject: [PATCH] xwm: use XKillClient to close windows that don't support WM_DELETE_WINDOW --- xwm/lucca-window.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/xwm/lucca-window.c b/xwm/lucca-window.c index 8e9f530..73ce221 100644 --- a/xwm/lucca-window.c +++ b/xwm/lucca-window.c @@ -917,7 +917,20 @@ void lucca_window_close(LuccaWindow* window) { } } else { - /* FIXME: The ICCCM says we can XKillClient the client in this case */ + /* The ICCCM says we can XKillClient the client in this case */ + gint error; + + gdk_error_trap_push(); + + XKillClient(window->display->xdisplay, window->xwindow); + + error = gdk_error_trap_pop(); + if (error == BadValue) { + window->badwindow = TRUE; + } + else if (error != 0) { + g_error("Unexpected X error: %i\n", error); + } } } } -- 2.11.4.GIT