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

View File

@ -309,7 +309,9 @@ event_unmapnotify(XEvent *e)
struct client *c;
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);
else if((s = systray_find(ev->window)))
{