event: Fix configure request handle

This commit is contained in:
Martin Duquesnoy 2008-11-21 02:21:43 +01:00
parent 4ff699dcd6
commit fdb38b5dec
4 changed files with 23 additions and 51 deletions

View File

@ -270,8 +270,6 @@ client_get_name(Client *c)
void
client_hide(Client *c)
{
CHECK(!c->unmapwithevent);
client_unmap(c);
c->hide = True;
setwinstate(c->win, IconicState);
@ -584,8 +582,6 @@ 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

@ -106,38 +106,28 @@ configurerequest(XConfigureRequestEvent *ev)
{
Client *c;
XWindowChanges wc;
XRectangle geo;
if((c = client_gb_win(ev->window)))
{
CHECK(!c->tile);
CHECK(!c->lmax);
if(ev->value_mask & CWX)
geo.x = ev->x;
if(ev->value_mask & CWY)
geo.y = ev->y;
if(ev->value_mask & CWWidth)
geo.width = ev->width;
if(ev->value_mask & CWHeight)
geo.height = ev->height;
if((ev->value_mask & (CWX | CWY))
&& !(ev->value_mask & (CWWidth | CWHeight)))
client_configure(c);
if(geo.x != c->geo.x
|| geo.y != c->geo.y
|| geo.width != c->geo.width
|| geo.height != c->geo.height)
{
geo.x += BORDH;
geo.y += TBARH;
if((geo.x < MAXW && geo.x > 0 - geo.width)
&& (geo.y < MAXH && geo.y > 0 - geo.height))
client_moveresize(c, geo, True);
}
else
client_configure(c);
c->geo.x = ev->x + BORDH;
c->geo.y = ev->y + TBARH;
c->geo.width = ev->width;
c->geo.height = ev->height;
wc.x = BORDH;
wc.y = TBARH + BORDH;
wc.width = c->geo.width;
wc.height = c->geo.height;
wc.border_width = ev->border_width;
wc.sibling = ev->above;
wc.stack_mode = ev->detail;
XConfigureWindow(dpy, c->win, ev->value_mask, &wc);
client_configure(c);
}
else
{
@ -304,15 +294,7 @@ maprequest(XMapRequestEvent *ev)
if(!(c = client_gb_win(ev->window)))
client_manage(ev->window, &at);
else
/* Re-map the clients that was unmapped
* with the unmap event
*/
if(c->unmapped)
{
client_map(c);
c->unmapwithevent = False;
}
client_map(c);
return;
}
@ -360,10 +342,7 @@ unmapnotify(XUnmapEvent *ev)
if((c = client_gb_win(ev->window))
&& ev->send_event)
{
client_unmap(c);
c->unmapwithevent = True;
}
client_unmanage(c);
return;
}
@ -376,8 +355,6 @@ unmapnotify(XUnmapEvent *ev)
void
getevent(XEvent ev)
{
switch (ev.type)
{
case ButtonPress: buttonpress(&ev.xbutton); break;
@ -393,6 +370,5 @@ getevent(XEvent ev)
case UnmapNotify: unmapnotify(&ev.xunmap); break;
}
return;
}

View File

@ -87,7 +87,7 @@ frame_create(Client *c)
CWBackPixel, color_enlight(c->colors.frame), &at);
CWIN(c->top, c->frame, 0, 0, c->frame_geo.width, SHADH, 0,
CWBackPixel, color_enlight(c->colors.frame), &at);
CWIN(c->bottom, c->frame, 0, c->frame_geo.height, c->frame_geo.width, SHADH, 0,
CWIN(c->bottom, c->frame, 0, c->frame_geo.height - SHADH, c->frame_geo.width, SHADH, 0,
CWBackPixel, SHADC, &at);
CWIN(c->right, c->frame, c->frame_geo.width - SHADH, 0, SHADH, c->frame_geo.height, 0,
CWBackPixel, SHADC, &at);
@ -125,10 +125,10 @@ frame_delete(Client *c)
void
frame_moveresize(Client *c, XRectangle geo)
{
c->frame_geo.x = geo.x - BORDH;
c->frame_geo.y = geo.y - TBARH;
c->frame_geo.width = FRAMEW(geo.width);
c->frame_geo.height = FRAMEH(geo.height);
c->frame_geo.x = geo.x - BORDH;
c->frame_geo.y = geo.y - TBARH;
c->frame_geo.width = FRAMEW(geo.width);
c->frame_geo.height = FRAMEH(geo.height);
/* Frame */
XMoveResizeWindow(dpy, c->frame,

View File

@ -103,7 +103,7 @@ struct Client
} colors;
/* Client Layout Information */
Bool max, tile, free, hide;
Bool hint, lmax, unmapped, unmapwithevent;
Bool hint, lmax, unmapped;
/* Struct in chains */
Client *next;
Client *prev;