Add condition in unmap event

This commit is contained in:
Martin Duquesnoy 2012-02-11 00:35:13 +01:00
parent 399fded639
commit 652b31dc0f
2 changed files with 7 additions and 5 deletions

View File

@ -1392,15 +1392,14 @@ client_remove(struct client *c)
XGrabServer(W->dpy); XGrabServer(W->dpy);
XSetErrorHandler(wmfs_error_handler_dummy); XSetErrorHandler(wmfs_error_handler_dummy);
client_map(c);
XReparentWindow(W->dpy, c->win, W->root, c->rgeo.x, c->rgeo.y); XReparentWindow(W->dpy, c->win, W->root, c->rgeo.x, c->rgeo.y);
XMapWindow(W->dpy, c->win);
client_untab(c); client_untab(c);
XDestroyWindow(W->dpy, c->frame);
if(c->titlebar) if(c->titlebar)
barwin_remove(c->titlebar); barwin_remove(c->titlebar);
XDestroyWindow(W->dpy, c->frame);
/* Remove from global client list */ /* Remove from global client list */
SLIST_REMOVE(&W->h.client, c, client, next); SLIST_REMOVE(&W->h.client, c, client, next);
@ -1410,11 +1409,12 @@ client_remove(struct client *c)
ewmh_set_wm_state(c->win, WithdrawnState); ewmh_set_wm_state(c->win, WithdrawnState);
XUngrabServer(W->dpy); XUngrabServer(W->dpy);
XSetErrorHandler(wmfs_error_handler);
free(c); free(c);
ewmh_get_client_list(); ewmh_get_client_list();
XSetErrorHandler(wmfs_error_handler);
} }
void void

View File

@ -309,7 +309,9 @@ event_unmapnotify(XEvent *e)
struct client *c; struct client *c;
struct _systray *s; struct _systray *s;
if((c = client_gb_win(ev->window)) && ev->send_event) if((c = client_gb_win(ev->window))
&& ev->send_event
&& c->flags & CLIENT_MAPPED)
client_remove(c); client_remove(c);
else if((s = systray_find(ev->window))) else if((s = systray_find(ev->window)))
{ {