summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorarg@mmvi <unknown>2006-09-26 07:40:19 +0200
committerarg@mmvi <unknown>2006-09-26 07:40:19 +0200
commitb4d53bf194f9f9214b6c79d397d723ba53663b4b (patch)
treeb1335d83f27a3a8225dd59de955224db48a1f095
parentslight change of event handling order (diff)
downloaddwm-b4d53bf194f9f9214b6c79d397d723ba53663b4b.tar.gz
dwm-b4d53bf194f9f9214b6c79d397d723ba53663b4b.zip
added configure(), but this doesn't really fix those frking broken SDL apps
-rw-r--r--client.c18
-rw-r--r--dwm.h1
-rw-r--r--event.c21
3 files changed, 27 insertions, 13 deletions
diff --git a/client.c b/client.c
index d5bc30e..87c2f76 100644
--- a/client.c
+++ b/client.c
@@ -81,6 +81,23 @@ ban(Client *c) {
81} 81}
82 82
83void 83void
84configure(Client *c) {
85 XEvent synev;
86
87 synev.type = ConfigureNotify;
88 synev.xconfigure.display = dpy;
89 synev.xconfigure.event = c->win;
90 synev.xconfigure.window = c->win;
91 synev.xconfigure.x = c->x;
92 synev.xconfigure.y = c->y;
93 synev.xconfigure.width = c->w;
94 synev.xconfigure.height = c->h;
95 synev.xconfigure.border_width = c->border;
96 synev.xconfigure.above = None;
97 XSendEvent(dpy, c->win, True, NoEventMask, &synev);
98}
99
100void
84focus(Client *c) { 101focus(Client *c) {
85 Client *old; 102 Client *old;
86 103
@@ -299,6 +316,7 @@ resize(Client *c, Bool sizehints, Corner sticky) {
299 else 316 else
300 wc.border_width = 1; 317 wc.border_width = 1;
301 XConfigureWindow(dpy, c->win, CWX | CWY | CWWidth | CWHeight | CWBorderWidth, &wc); 318 XConfigureWindow(dpy, c->win, CWX | CWY | CWWidth | CWHeight | CWBorderWidth, &wc);
319 configure(c);
302 XSync(dpy, False); 320 XSync(dpy, False);
303} 321}
304 322
diff --git a/dwm.h b/dwm.h
index c30f2b3..269c78e 100644
--- a/dwm.h
+++ b/dwm.h
@@ -109,6 +109,7 @@ extern Window root, barwin;
109 109
110/* client.c */ 110/* client.c */
111extern void ban(Client *c); /* ban c from screen */ 111extern void ban(Client *c); /* ban c from screen */
112extern void configure(Client *c); /* send synthetic configure event */
112extern void focus(Client *c); /* focus c, c may be NULL */ 113extern void focus(Client *c); /* focus c, c may be NULL */
113extern Client *getclient(Window w); /* return client of w */ 114extern Client *getclient(Window w); /* return client of w */
114extern Client *getctitle(Window w); /* return client of title window */ 115extern Client *getctitle(Window w); /* return client of title window */
diff --git a/event.c b/event.c
index cf89428..50c59a0 100644
--- a/event.c
+++ b/event.c
@@ -1,3 +1,4 @@
1#include <stdio.h>
1/* 2/*
2 * (C)opyright MMVI Anselm R. Garbe <garbeam at gmail dot com> 3 * (C)opyright MMVI Anselm R. Garbe <garbeam at gmail dot com>
3 * See LICENSE file for license details. 4 * See LICENSE file for license details.
@@ -38,6 +39,7 @@ movemouse(Client *c) {
38 XMaskEvent(dpy, MOUSEMASK | ExposureMask, &ev); 39 XMaskEvent(dpy, MOUSEMASK | ExposureMask, &ev);
39 switch (ev.type) { 40 switch (ev.type) {
40 case ButtonRelease: 41 case ButtonRelease:
42 resize(c, True, TopLeft);
41 XUngrabPointer(dpy, CurrentTime); 43 XUngrabPointer(dpy, CurrentTime);
42 return; 44 return;
43 case Expose: 45 case Expose:
@@ -71,6 +73,7 @@ resizemouse(Client *c) {
71 XMaskEvent(dpy, MOUSEMASK | ExposureMask, &ev); 73 XMaskEvent(dpy, MOUSEMASK | ExposureMask, &ev);
72 switch(ev.type) { 74 switch(ev.type) {
73 case ButtonRelease: 75 case ButtonRelease:
76 resize(c, True, TopLeft);
74 XUngrabPointer(dpy, CurrentTime); 77 XUngrabPointer(dpy, CurrentTime);
75 return; 78 return;
76 case Expose: 79 case Expose:
@@ -151,6 +154,7 @@ configurerequest(XEvent *e) {
151 XEvent synev; 154 XEvent synev;
152 XWindowChanges wc; 155 XWindowChanges wc;
153 156
157 fputs("configurerequest\n", stderr);
154 if((c = getclient(ev->window))) { 158 if((c = getclient(ev->window))) {
155 c->ismax = False; 159 c->ismax = False;
156 gravitate(c, True); 160 gravitate(c, True);
@@ -172,19 +176,8 @@ configurerequest(XEvent *e) {
172 newmask = ev->value_mask & (~(CWSibling | CWStackMode | CWBorderWidth)); 176 newmask = ev->value_mask & (~(CWSibling | CWStackMode | CWBorderWidth));
173 if(newmask) 177 if(newmask)
174 XConfigureWindow(dpy, c->win, newmask, &wc); 178 XConfigureWindow(dpy, c->win, newmask, &wc);
175 else { 179 else
176 synev.type = ConfigureNotify; 180 configure(c);
177 synev.xconfigure.display = dpy;
178 synev.xconfigure.event = c->win;
179 synev.xconfigure.window = c->win;
180 synev.xconfigure.x = c->x;
181 synev.xconfigure.y = c->y;
182 synev.xconfigure.width = c->w;
183 synev.xconfigure.height = c->h;
184 synev.xconfigure.border_width = c->border;
185 synev.xconfigure.above = None;
186 XSendEvent(dpy, c->win, True, NoEventMask, &synev);
187 }
188 XSync(dpy, False); 181 XSync(dpy, False);
189 if(c->isfloat) 182 if(c->isfloat)
190 resize(c, False, TopLeft); 183 resize(c, False, TopLeft);
@@ -218,6 +211,7 @@ enternotify(XEvent *e) {
218 Client *c; 211 Client *c;
219 XCrossingEvent *ev = &e->xcrossing; 212 XCrossingEvent *ev = &e->xcrossing;
220 213
214 fputs("enternotify\n", stderr);
221 if(ev->mode != NotifyNormal || ev->detail == NotifyInferior) 215 if(ev->mode != NotifyNormal || ev->detail == NotifyInferior)
222 return; 216 return;
223 217
@@ -305,6 +299,7 @@ propertynotify(XEvent *e) {
305 Window trans; 299 Window trans;
306 XPropertyEvent *ev = &e->xproperty; 300 XPropertyEvent *ev = &e->xproperty;
307 301
302 fputs("propertynotify\n", stderr);
308 if(ev->state == PropertyDelete) 303 if(ev->state == PropertyDelete)
309 return; /* ignore */ 304 return; /* ignore */
310 305