Map window at remove only if client has removeall state

This commit is contained in:
Martin Duquesnoy 2012-02-11 19:39:52 +01:00
parent d3718da15d
commit 6fe9b17e83
2 changed files with 14 additions and 7 deletions

View File

@ -1387,30 +1387,30 @@ client_remove(struct client *c)
{
c->flags |= CLIENT_DYING;
client_untab(c);
XGrabServer(W->dpy);
XSetErrorHandler(wmfs_error_handler_dummy);
XReparentWindow(W->dpy, c->win, W->root, c->rgeo.x, c->rgeo.y);
XMapWindow(W->dpy, c->win);
if(c->flags & CLIENT_REMOVEALL)
XMapWindow(W->dpy, c->win);
XUngrabButton(W->dpy, AnyButton, AnyModifier, c->win);
ewmh_set_wm_state(c->win, WithdrawnState);
client_untab(c);
/* Remove frame */
if(c->titlebar)
barwin_remove(c->titlebar);
XDestroyWindow(W->dpy, c->frame);
XSync(W->dpy, false);
XSetErrorHandler(wmfs_error_handler);
XUngrabServer(W->dpy);
/* Remove from global client list */
SLIST_REMOVE(&W->h.client, c, client, next);
tag_client(NULL, c);
free(c);
ewmh_get_client_list();
XSetErrorHandler(wmfs_error_handler);
}
void

View File

@ -23,6 +23,7 @@
#include "config.h"
#include "client.h"
#include "layout.h"
#include "systray.h"
int
wmfs_error_handler(Display *d, XErrorEvent *event)
@ -243,6 +244,12 @@ wmfs_scan(void)
if(!wa.override_redirect && wa.map_state == IsViewable)
{
if(ewmh_get_xembed_state(w[i]))
{
systray_add(w[i]);
continue;
}
if(XGetWindowProperty(W->dpy, w[i], ATOM("_WMFS_TAG"), 0, 32,
False, XA_CARDINAL, &rt, &rf, &ir, &il,
(unsigned char**)&ret)