summaryrefslogtreecommitdiffstats
path: root/event.c
diff options
context:
space:
mode:
authorAnselm R. Garbe <garbeam@wmii.de>2006-07-11 16:14:22 +0200
committerAnselm R. Garbe <garbeam@wmii.de>2006-07-11 16:14:22 +0200
commit33996500763b04119a6867dfa4040a4236c21a41 (patch)
tree7abc832f02c0478dd9b8e339c3ee7874d1bb7787 /event.c
parentnew stuff (diff)
downloaddwm-33996500763b04119a6867dfa4040a4236c21a41.tar.gz
dwm-33996500763b04119a6867dfa4040a4236c21a41.zip
added protocol killing stuff
Diffstat (limited to 'event.c')
-rw-r--r--event.c50
1 files changed, 33 insertions, 17 deletions
diff --git a/event.c b/event.c
index d168787..ccab9d1 100644
--- a/event.c
+++ b/event.c
@@ -7,6 +7,7 @@
7#include <stdlib.h> 7#include <stdlib.h>
8#include <string.h> 8#include <string.h>
9#include <X11/keysym.h> 9#include <X11/keysym.h>
10#include <X11/Xatom.h>
10 11
11#include "wm.h" 12#include "wm.h"
12 13
@@ -35,7 +36,7 @@ void (*handler[LASTEvent]) (XEvent *) = {
35}; 36};
36 37
37unsigned int 38unsigned int
38flush_masked_events(long even_mask) 39flush_events(long even_mask)
39{ 40{
40 XEvent ev; 41 XEvent ev;
41 unsigned int n = 0; 42 unsigned int n = 0;
@@ -91,25 +92,18 @@ destroynotify(XEvent *e)
91static void 92static void
92enternotify(XEvent *e) 93enternotify(XEvent *e)
93{ 94{
94#if 0
95 XCrossingEvent *ev = &e->xcrossing; 95 XCrossingEvent *ev = &e->xcrossing;
96 Client *c; 96 Client *c;
97 97
98 if(ev->mode != NotifyNormal || ev->detail == NotifyInferior) 98 if(ev->mode != NotifyNormal || ev->detail == NotifyInferior)
99 return; 99 return;
100 100
101 if((c = client_of_win(ev->window))) { 101 if((c = getclient(ev->window)))
102 Frame *f = c->sel; 102 focus(c);
103 Area *a = f->area;
104 if(a->mode == Colmax)
105 c = a->sel->client;
106 focus(c, False);
107 }
108 else if(ev->window == root) { 103 else if(ev->window == root) {
109 sel_screen = True; 104 sel_screen = True;
110 draw_frames(); 105 /*draw_frames();*/
111 } 106 }
112#endif
113} 107}
114 108
115static void 109static void
@@ -137,9 +131,7 @@ expose(XEvent *e)
137static void 131static void
138keymapnotify(XEvent *e) 132keymapnotify(XEvent *e)
139{ 133{
140#if 0
141 update_keys(); 134 update_keys();
142#endif
143} 135}
144 136
145static void 137static void
@@ -164,16 +156,40 @@ maprequest(XEvent *e)
164static void 156static void
165propertynotify(XEvent *e) 157propertynotify(XEvent *e)
166{ 158{
167#if 0
168 XPropertyEvent *ev = &e->xproperty; 159 XPropertyEvent *ev = &e->xproperty;
160 long msize;
169 Client *c; 161 Client *c;
170 162
171 if(ev->state == PropertyDelete) 163 if(ev->state == PropertyDelete)
172 return; /* ignore */ 164 return; /* ignore */
173 165
174 if((c = client_of_win(ev->window))) 166 if(ev->atom == wm_atom[WMProtocols]) {
175 prop_client(c, ev); 167 c->proto = win_proto(c->win);
176#endif 168 return;
169 }
170 if((c = getclient(ev->window))) {
171 switch (ev->atom) {
172 default: break;
173 case XA_WM_TRANSIENT_FOR:
174 XGetTransientForHint(dpy, c->win, &c->trans);
175 break;
176 case XA_WM_NORMAL_HINTS:
177 if(!XGetWMNormalHints(dpy, c->win, &c->size, &msize)
178 || !c->size.flags)
179 c->size.flags = PSize;
180 if(c->size.flags & PMinSize && c->size.flags & PMaxSize
181 && c->size.min_width == c->size.max_width
182 && c->size.min_height == c->size.max_height)
183 c->fixedsize = True;
184 else
185 c->fixedsize = False;
186 break;
187 }
188 if(ev->atom == XA_WM_NAME || ev->atom == net_atom[NetWMName]) {
189 update_name(c);
190 /*draw_frame(c->sel);*/
191 }
192 }
177} 193}
178 194
179static void 195static void