commit adc911c49842d1a8c03e366d8ea24e97d94410ab
parent 53c458027729eecfb5f013d88acc9cd7cd8e451d
Author: Raymond Cole <rc@wolog.xyz>
Date: Mon, 4 Nov 2024 12:32:43 +0000
Tidy ConfigureRequest event handler
Diffstat:
M | evt.c | | | 32 | +++++++++++++------------------- |
1 file changed, 13 insertions(+), 19 deletions(-)
diff --git a/evt.c b/evt.c
@@ -100,26 +100,9 @@ configurerequest(XEvent *e)
{
XConfigureRequestEvent *ev = &e->xconfigurerequest;
Client *c;
- Monitor *m;
XWindowChanges wc;
- if ((c = wintoclient(ev->window))) {
- if (!c->isfullscreen && (c->isfloating || !selmon->lyt)) {
- m = c->mon;
- if (ev->value_mask & CWX)
- c->x = m->x + ev->x;
- if (ev->value_mask & CWY)
- c->y = m->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 & (CWX|CWY|CWWidth|CWHeight))
- configure(c, ev->value_mask & (CWWidth|CWHeight));
- } else {
- notifyconfigure(c);
- }
- } else {
+ if (!(c = wintoclient(ev->window))) {
wc.x = ev->x;
wc.y = ev->y;
wc.width = ev->width;
@@ -128,8 +111,19 @@ configurerequest(XEvent *e)
wc.sibling = ev->above;
wc.stack_mode = ev->detail;
XConfigureWindow(dpy, ev->window, ev->value_mask, &wc);
+ } else if (c->isfullscreen || (selmon->lyt && !c->isfloating)) {
+ notifyconfigure(c);
+ } else if (ev->value_mask & (CWX|CWY|CWWidth|CWHeight)) {
+ if (ev->value_mask & CWX)
+ c->x = c->mon->x + ev->x;
+ if (ev->value_mask & CWY)
+ c->y = c->mon->y + ev->y;
+ if (ev->value_mask & CWWidth)
+ c->w = ev->width;
+ if (ev->value_mask & CWHeight)
+ c->h = ev->height;
+ configure(c, ev->value_mask & (CWWidth|CWHeight));
}
- XSync(dpy, False);
}
void