simplified configurerequest
This commit is contained in:
parent
6ba400ee0f
commit
71857b87ee
25
client.c
25
client.c
|
@ -69,19 +69,20 @@ xerrordummy(Display *dsply, XErrorEvent *ee) {
|
||||||
|
|
||||||
void
|
void
|
||||||
configure(Client *c) {
|
configure(Client *c) {
|
||||||
XEvent synev;
|
XConfigureEvent ce;
|
||||||
|
|
||||||
synev.type = ConfigureNotify;
|
ce.type = ConfigureNotify;
|
||||||
synev.xconfigure.display = dpy;
|
ce.display = dpy;
|
||||||
synev.xconfigure.event = c->win;
|
ce.event = c->win;
|
||||||
synev.xconfigure.window = c->win;
|
ce.window = c->win;
|
||||||
synev.xconfigure.x = c->x;
|
ce.x = c->x;
|
||||||
synev.xconfigure.y = c->y;
|
ce.y = c->y;
|
||||||
synev.xconfigure.width = c->w;
|
ce.width = c->w;
|
||||||
synev.xconfigure.height = c->h;
|
ce.height = c->h;
|
||||||
synev.xconfigure.border_width = c->border;
|
ce.border_width = c->border;
|
||||||
synev.xconfigure.above = None;
|
ce.above = None;
|
||||||
XSendEvent(dpy, c->win, True, NoEventMask, &synev);
|
ce.override_redirect = False;
|
||||||
|
XSendEvent(dpy, c->win, False, StructureNotifyMask, (XEvent *)&ce);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
47
event.c
47
event.c
|
@ -166,42 +166,10 @@ buttonpress(XEvent *e) {
|
||||||
|
|
||||||
static void
|
static void
|
||||||
configurerequest(XEvent *e) {
|
configurerequest(XEvent *e) {
|
||||||
unsigned long newmask;
|
|
||||||
Client *c;
|
Client *c;
|
||||||
XConfigureRequestEvent *ev = &e->xconfigurerequest;
|
XConfigureRequestEvent *ev = &e->xconfigurerequest;
|
||||||
XWindowChanges wc;
|
XWindowChanges wc;
|
||||||
|
|
||||||
if((c = getclient(ev->window))) {
|
|
||||||
c->ismax = False;
|
|
||||||
if(ev->value_mask & CWX)
|
|
||||||
c->x = ev->x;
|
|
||||||
if(ev->value_mask & CWY)
|
|
||||||
c->y = ev->y;
|
|
||||||
if(ev->value_mask & CWWidth)
|
|
||||||
c->w = ev->width;
|
|
||||||
if(ev->value_mask & CWHeight)
|
|
||||||
c->h = ev->height;
|
|
||||||
if(ev->value_mask & CWBorderWidth)
|
|
||||||
c->border = ev->border_width;
|
|
||||||
wc.x = c->x;
|
|
||||||
wc.y = c->y;
|
|
||||||
wc.width = c->w;
|
|
||||||
wc.height = c->h;
|
|
||||||
newmask = ev->value_mask & (~(CWSibling | CWStackMode | CWBorderWidth));
|
|
||||||
if(newmask)
|
|
||||||
XConfigureWindow(dpy, c->win, newmask, &wc);
|
|
||||||
else
|
|
||||||
configure(c);
|
|
||||||
XSync(dpy, False);
|
|
||||||
if(c->isfloat) {
|
|
||||||
resize(c, False);
|
|
||||||
if(!isvisible(c))
|
|
||||||
XMoveWindow(dpy, c->win, c->x + 2 * sw, c->y);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
arrange();
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
wc.x = ev->x;
|
wc.x = ev->x;
|
||||||
wc.y = ev->y;
|
wc.y = ev->y;
|
||||||
wc.width = ev->width;
|
wc.width = ev->width;
|
||||||
|
@ -209,9 +177,22 @@ configurerequest(XEvent *e) {
|
||||||
wc.border_width = ev->border_width;
|
wc.border_width = ev->border_width;
|
||||||
wc.sibling = ev->above;
|
wc.sibling = ev->above;
|
||||||
wc.stack_mode = ev->detail;
|
wc.stack_mode = ev->detail;
|
||||||
XConfigureWindow(dpy, ev->window, ev->value_mask, &wc);
|
if((c = getclient(ev->window))) {
|
||||||
|
c->ismax = False;
|
||||||
|
if(ev->value_mask & CWBorderWidth)
|
||||||
|
c->border = ev->border_width;
|
||||||
|
if((!c->isfloat && (arrange != dofloat))
|
||||||
|
|| ((ev->value_mask & (CWX|CWY)) && !(ev->value_mask & (CWWidth|CWHeight))))
|
||||||
|
{
|
||||||
|
configure(c);
|
||||||
XSync(dpy, False);
|
XSync(dpy, False);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
XConfigureWindow(dpy, ev->window, ev->value_mask, &wc);
|
||||||
|
if(c && !isvisible(c))
|
||||||
|
XMoveWindow(dpy, c->win, c->x + 2 * sw, c->y);
|
||||||
|
XSync(dpy, False);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
Loading…
Reference in New Issue