Don't remove node in close_window

If the window doesn't respond to the WM_DELETE_WINDOW message, we'll end
up with an unmanaged window. Besides, nodes are already removed after
receiving the corresponding destroy notifications.
This commit is contained in:
Bastien Dejean 2012-09-28 14:37:22 +02:00
parent e1330bfc34
commit 3c404e6bed
3 changed files with 3 additions and 4 deletions

View file

@ -38,7 +38,7 @@ void process_message(char *msg, char *rsp)
list_windows(rsp);
return;
} else if (strcmp(cmd, "close") == 0) {
close_window(desk, desk->focus);
close_window(desk->focus);
} else if (strcmp(cmd, "magnetise") == 0) {
char *cor = strtok(NULL, TOKEN_SEP);
if (cor != NULL) {

View file

@ -135,7 +135,7 @@ void window_draw_border(node_t *n, bool focused)
xcb_free_pixmap(dpy, pix);
}
void close_window(desktop_t *d, node_t *n)
void close_window(node_t *n)
{
if (n == NULL || n->client->locked)
return;
@ -164,7 +164,6 @@ void close_window(desktop_t *d, node_t *n)
e.data.data32[1] = XCB_CURRENT_TIME;
xcb_send_event(dpy, false, win, XCB_EVENT_MASK_NO_EVENT, (char *) &e);
remove_node(d, n);
}
void toggle_fullscreen(client_t *c)

View file

@ -8,7 +8,7 @@
bool locate_window(xcb_window_t, window_location_t *);
void window_draw_border(node_t *, bool);
void close_window(desktop_t *, node_t *);
void close_window(node_t *);
void toggle_fullscreen(client_t *);
void toggle_floating(node_t *);
void toggle_locked(client_t *);