diff --git a/src/client.c b/src/client.c index 2af5b7c..c6e5391 100644 --- a/src/client.c +++ b/src/client.c @@ -270,6 +270,8 @@ client_get_name(Client *c) void client_hide(Client *c) { + CHECK(!c->unmapwithevent); + client_unmap(c); c->hide = True; setwinstate(c->win, IconicState); @@ -582,6 +584,8 @@ uicb_client_raise(uicb_t cmd) void client_unhide(Client *c) { + CHECK(!c->unmapwithevent); + client_map(c); c->hide = False; setwinstate(c->win, NormalState); diff --git a/src/event.c b/src/event.c index 18af8a0..3a2f951 100644 --- a/src/event.c +++ b/src/event.c @@ -308,7 +308,10 @@ maprequest(XMapRequestEvent *ev) * with the unmap event */ if(c->unmapped) + { client_map(c); + c->unmapwithevent = False; + } return; @@ -357,7 +360,10 @@ unmapnotify(XUnmapEvent *ev) if((c = client_gb_win(ev->window)) && ev->send_event) + { client_unmap(c); + c->unmapwithevent = True; + } return; } diff --git a/src/structs.h b/src/structs.h index 839b60b..2c47481 100644 --- a/src/structs.h +++ b/src/structs.h @@ -103,7 +103,7 @@ struct Client } colors; /* Client Layout Information */ Bool max, tile, free, hide; - Bool hint, lmax, unmapped; + Bool hint, lmax, unmapped, unmapwithevent; /* Struct in chains */ Client *next; Client *prev; diff --git a/src/wmfs.c b/src/wmfs.c index 41e9cca..3059815 100644 --- a/src/wmfs.c +++ b/src/wmfs.c @@ -50,7 +50,10 @@ errorhandler(Display *d, XErrorEvent *event) if((c = client_gb_win(event->resourceid)) && c->unmapped && event->request_code == 42) + { + //client_kill(c); return 0; + } XGetErrorText(d, event->error_code, mess, 128); fprintf(stderr, "WMFS error: %s(%d) opcodes %d/%d\n resource #%lx\n", mess,