# HG changeset patch # User arg@mmvi # Date 1159249219 -7200 # Node ID 12395ef46d9755e17e24ed3e52fe13e7d0dbdc13 # Parent 303d3384720e34fa8e2eeb84fdd0a5fb2df8eee3 added configure(), but this doesn't really fix those frking broken SDL apps diff -r 303d3384720e -r 12395ef46d97 client.c --- a/client.c Mon Sep 25 21:28:00 2006 +0200 +++ b/client.c Tue Sep 26 07:40:19 2006 +0200 @@ -81,6 +81,23 @@ } void +configure(Client *c) { + XEvent synev; + + synev.type = ConfigureNotify; + synev.xconfigure.display = dpy; + synev.xconfigure.event = c->win; + synev.xconfigure.window = c->win; + synev.xconfigure.x = c->x; + synev.xconfigure.y = c->y; + synev.xconfigure.width = c->w; + synev.xconfigure.height = c->h; + synev.xconfigure.border_width = c->border; + synev.xconfigure.above = None; + XSendEvent(dpy, c->win, True, NoEventMask, &synev); +} + +void focus(Client *c) { Client *old; @@ -299,6 +316,7 @@ else wc.border_width = 1; XConfigureWindow(dpy, c->win, CWX | CWY | CWWidth | CWHeight | CWBorderWidth, &wc); + configure(c); XSync(dpy, False); } diff -r 303d3384720e -r 12395ef46d97 dwm.h --- a/dwm.h Mon Sep 25 21:28:00 2006 +0200 +++ b/dwm.h Tue Sep 26 07:40:19 2006 +0200 @@ -109,6 +109,7 @@ /* client.c */ extern void ban(Client *c); /* ban c from screen */ +extern void configure(Client *c); /* send synthetic configure event */ extern void focus(Client *c); /* focus c, c may be NULL */ extern Client *getclient(Window w); /* return client of w */ extern Client *getctitle(Window w); /* return client of title window */ diff -r 303d3384720e -r 12395ef46d97 event.c --- a/event.c Mon Sep 25 21:28:00 2006 +0200 +++ b/event.c Tue Sep 26 07:40:19 2006 +0200 @@ -1,3 +1,4 @@ +#include /* * (C)opyright MMVI Anselm R. Garbe * See LICENSE file for license details. @@ -38,6 +39,7 @@ XMaskEvent(dpy, MOUSEMASK | ExposureMask, &ev); switch (ev.type) { case ButtonRelease: + resize(c, True, TopLeft); XUngrabPointer(dpy, CurrentTime); return; case Expose: @@ -71,6 +73,7 @@ XMaskEvent(dpy, MOUSEMASK | ExposureMask, &ev); switch(ev.type) { case ButtonRelease: + resize(c, True, TopLeft); XUngrabPointer(dpy, CurrentTime); return; case Expose: @@ -151,6 +154,7 @@ XEvent synev; XWindowChanges wc; + fputs("configurerequest\n", stderr); if((c = getclient(ev->window))) { c->ismax = False; gravitate(c, True); @@ -172,19 +176,8 @@ newmask = ev->value_mask & (~(CWSibling | CWStackMode | CWBorderWidth)); if(newmask) XConfigureWindow(dpy, c->win, newmask, &wc); - else { - synev.type = ConfigureNotify; - synev.xconfigure.display = dpy; - synev.xconfigure.event = c->win; - synev.xconfigure.window = c->win; - synev.xconfigure.x = c->x; - synev.xconfigure.y = c->y; - synev.xconfigure.width = c->w; - synev.xconfigure.height = c->h; - synev.xconfigure.border_width = c->border; - synev.xconfigure.above = None; - XSendEvent(dpy, c->win, True, NoEventMask, &synev); - } + else + configure(c); XSync(dpy, False); if(c->isfloat) resize(c, False, TopLeft); @@ -218,6 +211,7 @@ Client *c; XCrossingEvent *ev = &e->xcrossing; + fputs("enternotify\n", stderr); if(ev->mode != NotifyNormal || ev->detail == NotifyInferior) return; @@ -305,6 +299,7 @@ Window trans; XPropertyEvent *ev = &e->xproperty; + fputs("propertynotify\n", stderr); if(ev->state == PropertyDelete) return; /* ignore */