event: Add unmapwithevent in Client structure for specify the unmap reason of the client and manage it

This commit is contained in:
Martin Duquesnoy 2008-11-20 23:13:51 +01:00
parent cda95f3dcc
commit 4ff699dcd6
4 changed files with 14 additions and 1 deletions

View File

@ -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);

View File

@ -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;
}

View File

@ -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;

View File

@ -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,