aewl

changeset 491:12395ef46d97

added configure(), but this doesn't really fix those frking broken SDL apps
author arg@mmvi
date Tue, 26 Sep 2006 07:40:19 +0200
parents 303d3384720e
children 5df494262dfd
files client.c dwm.h event.c
diffstat 3 files changed, 27 insertions(+), 13 deletions(-) [+]
line diff
     1.1 --- a/client.c	Mon Sep 25 21:28:00 2006 +0200
     1.2 +++ b/client.c	Tue Sep 26 07:40:19 2006 +0200
     1.3 @@ -81,6 +81,23 @@
     1.4  }
     1.5  
     1.6  void
     1.7 +configure(Client *c) {
     1.8 +	XEvent synev;
     1.9 +
    1.10 +	synev.type = ConfigureNotify;
    1.11 +	synev.xconfigure.display = dpy;
    1.12 +	synev.xconfigure.event = c->win;
    1.13 +	synev.xconfigure.window = c->win;
    1.14 +	synev.xconfigure.x = c->x;
    1.15 +	synev.xconfigure.y = c->y;
    1.16 +	synev.xconfigure.width = c->w;
    1.17 +	synev.xconfigure.height = c->h;
    1.18 +	synev.xconfigure.border_width = c->border;
    1.19 +	synev.xconfigure.above = None;
    1.20 +	XSendEvent(dpy, c->win, True, NoEventMask, &synev);
    1.21 +}
    1.22 +
    1.23 +void
    1.24  focus(Client *c) {
    1.25  	Client *old;
    1.26  
    1.27 @@ -299,6 +316,7 @@
    1.28  	else
    1.29  		wc.border_width = 1;
    1.30  	XConfigureWindow(dpy, c->win, CWX | CWY | CWWidth | CWHeight | CWBorderWidth, &wc);
    1.31 +	configure(c);
    1.32  	XSync(dpy, False);
    1.33  }
    1.34  
     2.1 --- a/dwm.h	Mon Sep 25 21:28:00 2006 +0200
     2.2 +++ b/dwm.h	Tue Sep 26 07:40:19 2006 +0200
     2.3 @@ -109,6 +109,7 @@
     2.4  
     2.5  /* client.c */
     2.6  extern void ban(Client *c);			/* ban c from screen */
     2.7 +extern void configure(Client *c);		/* send synthetic configure event */
     2.8  extern void focus(Client *c);			/* focus c, c may be NULL */
     2.9  extern Client *getclient(Window w);		/* return client of w */
    2.10  extern Client *getctitle(Window w);		/* return client of title window */
     3.1 --- a/event.c	Mon Sep 25 21:28:00 2006 +0200
     3.2 +++ b/event.c	Tue Sep 26 07:40:19 2006 +0200
     3.3 @@ -1,3 +1,4 @@
     3.4 +#include <stdio.h>
     3.5  /*
     3.6   * (C)opyright MMVI Anselm R. Garbe <garbeam at gmail dot com>
     3.7   * See LICENSE file for license details.
     3.8 @@ -38,6 +39,7 @@
     3.9  		XMaskEvent(dpy, MOUSEMASK | ExposureMask, &ev);
    3.10  		switch (ev.type) {
    3.11  		case ButtonRelease:
    3.12 +			resize(c, True, TopLeft);
    3.13  			XUngrabPointer(dpy, CurrentTime);
    3.14  			return;
    3.15  		case Expose:
    3.16 @@ -71,6 +73,7 @@
    3.17  		XMaskEvent(dpy, MOUSEMASK | ExposureMask, &ev);
    3.18  		switch(ev.type) {
    3.19  		case ButtonRelease:
    3.20 +			resize(c, True, TopLeft);
    3.21  			XUngrabPointer(dpy, CurrentTime);
    3.22  			return;
    3.23  		case Expose:
    3.24 @@ -151,6 +154,7 @@
    3.25  	XEvent synev;
    3.26  	XWindowChanges wc;
    3.27  
    3.28 +	fputs("configurerequest\n", stderr);
    3.29  	if((c = getclient(ev->window))) {
    3.30  		c->ismax = False;
    3.31  		gravitate(c, True);
    3.32 @@ -172,19 +176,8 @@
    3.33  		newmask = ev->value_mask & (~(CWSibling | CWStackMode | CWBorderWidth));
    3.34  		if(newmask)
    3.35  			XConfigureWindow(dpy, c->win, newmask, &wc);
    3.36 -		else {
    3.37 -			synev.type = ConfigureNotify;
    3.38 -			synev.xconfigure.display = dpy;
    3.39 -			synev.xconfigure.event = c->win;
    3.40 -			synev.xconfigure.window = c->win;
    3.41 -			synev.xconfigure.x = c->x;
    3.42 -			synev.xconfigure.y = c->y;
    3.43 -			synev.xconfigure.width = c->w;
    3.44 -			synev.xconfigure.height = c->h;
    3.45 -			synev.xconfigure.border_width = c->border;
    3.46 -			synev.xconfigure.above = None;
    3.47 -			XSendEvent(dpy, c->win, True, NoEventMask, &synev);
    3.48 -		}
    3.49 +		else
    3.50 +			configure(c);
    3.51  		XSync(dpy, False);
    3.52  		if(c->isfloat)
    3.53  			resize(c, False, TopLeft);
    3.54 @@ -218,6 +211,7 @@
    3.55  	Client *c;
    3.56  	XCrossingEvent *ev = &e->xcrossing;
    3.57  
    3.58 +	fputs("enternotify\n", stderr);
    3.59  	if(ev->mode != NotifyNormal || ev->detail == NotifyInferior)
    3.60  		return;
    3.61  
    3.62 @@ -305,6 +299,7 @@
    3.63  	Window trans;
    3.64  	XPropertyEvent *ev = &e->xproperty;
    3.65  
    3.66 +	fputs("propertynotify\n", stderr);
    3.67  	if(ev->state == PropertyDelete)
    3.68  		return; /* ignore */
    3.69