Mercurial > aewl
annotate event.c @ 707:c3c57faef013
leavenotify also don't needs the check
author | Anselm R. Garbe <arg@suckless.org> |
---|---|
date | Fri, 19 Jan 2007 15:05:07 +0100 |
parents | 163fdca8f064 |
children | a2d568a5cdb8 |
rev | line source |
---|---|
644 | 1 /* (C)opyright MMVI-MMVII Anselm R. Garbe <garbeam at gmail dot com> |
5 | 2 * See LICENSE file for license details. |
3 */ | |
76
4bd49f404f10
proceeded with cleaning up, sorting functions, etc
Anselm R. Garbe <garbeam@wmii.de>
parents:
75
diff
changeset
|
4 #include "dwm.h" |
5 | 5 #include <stdlib.h> |
6 #include <X11/keysym.h> | |
13
5cc5e55a132d
added protocol killing stuff
Anselm R. Garbe <garbeam@wmii.de>
parents:
11
diff
changeset
|
7 #include <X11/Xatom.h> |
5 | 8 |
146
f328ce9c558c
centralized/externalized configuration to config.h
arg@10ksloc.org
parents:
145
diff
changeset
|
9 /* static */ |
114 | 10 |
11 typedef struct { | |
12 unsigned long mod; | |
13 KeySym keysym; | |
589 | 14 void (*func)(Arg *arg); |
114 | 15 Arg arg; |
16 } Key; | |
17 | |
146
f328ce9c558c
centralized/externalized configuration to config.h
arg@10ksloc.org
parents:
145
diff
changeset
|
18 KEYS |
75 | 19 |
291
8e6e0aa5e2ae
removed NUMLOCKMASK, added dynamically calculated numlockmask instead
Anselm R.Garbe <arg@10ksloc.org>
parents:
288
diff
changeset
|
20 #define CLEANMASK(mask) (mask & ~(numlockmask | LockMask)) |
538
00ccae001069
moved MOUSEMASK into event.c (not used in other places)
Anselm R. Garbe <arg@10kloc.org>
parents:
533
diff
changeset
|
21 #define MOUSEMASK (BUTTONMASK | PointerMotionMask) |
75 | 22 |
77 | 23 static void |
461
9d23330a5268
removed a bunch of lines through making function signatures more consistent with my style ( { does not belong to a new line, if function args are single-lined)
Anselm R. Garbe <arg@10kloc.org>
parents:
454
diff
changeset
|
24 movemouse(Client *c) { |
77 | 25 int x1, y1, ocx, ocy, di; |
26 unsigned int dui; | |
27 Window dummy; | |
123 | 28 XEvent ev; |
77 | 29 |
115
329fd7dae530
removed c->f{x,y,w,h} and c->t{x,y,w,h} in favor for the new rule handling remembering two kinds of geometries is unnecessary, removed the randomized (x,y) setting on dofloat startup, was kind too random und unpredictable
arg@10ksloc.org
parents:
114
diff
changeset
|
30 ocx = c->x; |
329fd7dae530
removed c->f{x,y,w,h} and c->t{x,y,w,h} in favor for the new rule handling remembering two kinds of geometries is unnecessary, removed the randomized (x,y) setting on dofloat startup, was kind too random und unpredictable
arg@10ksloc.org
parents:
114
diff
changeset
|
31 ocy = c->y; |
148
5267e1204367
uppercasing all define'd values (uppercase-prefixed should only be enum field qualifiers)
arg@10ksloc.org
parents:
146
diff
changeset
|
32 if(XGrabPointer(dpy, root, False, MOUSEMASK, GrabModeAsync, GrabModeAsync, |
123 | 33 None, cursor[CurMove], CurrentTime) != GrabSuccess) |
77 | 34 return; |
482 | 35 c->ismax = False; |
77 | 36 XQueryPointer(dpy, root, &dummy, &dummy, &x1, &y1, &di, &di, &dui); |
37 for(;;) { | |
489 | 38 XMaskEvent(dpy, MOUSEMASK | ExposureMask, &ev); |
77 | 39 switch (ev.type) { |
490 | 40 case ButtonRelease: |
491
12395ef46d97
added configure(), but this doesn't really fix those frking broken SDL apps
arg@mmvi
parents:
490
diff
changeset
|
41 resize(c, True, TopLeft); |
490 | 42 XUngrabPointer(dpy, CurrentTime); |
43 return; | |
77 | 44 case Expose: |
45 handler[Expose](&ev); | |
46 break; | |
47 case MotionNotify: | |
79
aabebd6e61f3
fixed XSync handling and finished man page
Anselm R. Garbe <garbeam@wmii.de>
parents:
78
diff
changeset
|
48 XSync(dpy, False); |
115
329fd7dae530
removed c->f{x,y,w,h} and c->t{x,y,w,h} in favor for the new rule handling remembering two kinds of geometries is unnecessary, removed the randomized (x,y) setting on dofloat startup, was kind too random und unpredictable
arg@10ksloc.org
parents:
114
diff
changeset
|
49 c->x = ocx + (ev.xmotion.x - x1); |
329fd7dae530
removed c->f{x,y,w,h} and c->t{x,y,w,h} in favor for the new rule handling remembering two kinds of geometries is unnecessary, removed the randomized (x,y) setting on dofloat startup, was kind too random und unpredictable
arg@10ksloc.org
parents:
114
diff
changeset
|
50 c->y = ocy + (ev.xmotion.y - y1); |
565 | 51 if(abs(wax + c->x) < SNAP) |
52 c->x = wax; | |
53 else if(abs((wax + waw) - (c->x + c->w)) < SNAP) | |
54 c->x = wax + waw - c->w - 2 * BORDERPX; | |
55 if(abs(way - c->y) < SNAP) | |
56 c->y = way; | |
57 else if(abs((way + wah) - (c->y + c->h)) < SNAP) | |
58 c->y = way + wah - c->h - 2 * BORDERPX; | |
99
a19556fe83b5
applied Sanders resize patch, fixed lower bug
arg@10ksloc.org
parents:
95
diff
changeset
|
59 resize(c, False, TopLeft); |
77 | 60 break; |
61 } | |
62 } | |
63 } | |
64 | |
65 static void | |
461
9d23330a5268
removed a bunch of lines through making function signatures more consistent with my style ( { does not belong to a new line, if function args are single-lined)
Anselm R. Garbe <arg@10kloc.org>
parents:
454
diff
changeset
|
66 resizemouse(Client *c) { |
77 | 67 int ocx, ocy; |
268
a47b3b0d7bf4
applied Sanders LD and resize patches
Anselm R.Garbe <arg@10ksloc.org>
parents:
267
diff
changeset
|
68 int nw, nh; |
99
a19556fe83b5
applied Sanders resize patch, fixed lower bug
arg@10ksloc.org
parents:
95
diff
changeset
|
69 Corner sticky; |
123 | 70 XEvent ev; |
77 | 71 |
115
329fd7dae530
removed c->f{x,y,w,h} and c->t{x,y,w,h} in favor for the new rule handling remembering two kinds of geometries is unnecessary, removed the randomized (x,y) setting on dofloat startup, was kind too random und unpredictable
arg@10ksloc.org
parents:
114
diff
changeset
|
72 ocx = c->x; |
329fd7dae530
removed c->f{x,y,w,h} and c->t{x,y,w,h} in favor for the new rule handling remembering two kinds of geometries is unnecessary, removed the randomized (x,y) setting on dofloat startup, was kind too random und unpredictable
arg@10ksloc.org
parents:
114
diff
changeset
|
73 ocy = c->y; |
148
5267e1204367
uppercasing all define'd values (uppercase-prefixed should only be enum field qualifiers)
arg@10ksloc.org
parents:
146
diff
changeset
|
74 if(XGrabPointer(dpy, root, False, MOUSEMASK, GrabModeAsync, GrabModeAsync, |
532
651f2c868b31
code polishing, removed unnecessary newlines
Anselm R. Garbe <arg@10kloc.org>
parents:
530
diff
changeset
|
75 None, cursor[CurResize], CurrentTime) != GrabSuccess) |
77 | 76 return; |
482 | 77 c->ismax = False; |
115
329fd7dae530
removed c->f{x,y,w,h} and c->t{x,y,w,h} in favor for the new rule handling remembering two kinds of geometries is unnecessary, removed the randomized (x,y) setting on dofloat startup, was kind too random und unpredictable
arg@10ksloc.org
parents:
114
diff
changeset
|
78 XWarpPointer(dpy, None, c->win, 0, 0, 0, 0, c->w, c->h); |
77 | 79 for(;;) { |
489 | 80 XMaskEvent(dpy, MOUSEMASK | ExposureMask, &ev); |
77 | 81 switch(ev.type) { |
490 | 82 case ButtonRelease: |
491
12395ef46d97
added configure(), but this doesn't really fix those frking broken SDL apps
arg@mmvi
parents:
490
diff
changeset
|
83 resize(c, True, TopLeft); |
490 | 84 XUngrabPointer(dpy, CurrentTime); |
85 return; | |
77 | 86 case Expose: |
87 handler[Expose](&ev); | |
88 break; | |
89 case MotionNotify: | |
79
aabebd6e61f3
fixed XSync handling and finished man page
Anselm R. Garbe <garbeam@wmii.de>
parents:
78
diff
changeset
|
90 XSync(dpy, False); |
268
a47b3b0d7bf4
applied Sanders LD and resize patches
Anselm R.Garbe <arg@10ksloc.org>
parents:
267
diff
changeset
|
91 if((nw = abs(ocx - ev.xmotion.x))) |
478 | 92 c->w = nw; |
268
a47b3b0d7bf4
applied Sanders LD and resize patches
Anselm R.Garbe <arg@10ksloc.org>
parents:
267
diff
changeset
|
93 if((nh = abs(ocy - ev.xmotion.y))) |
478 | 94 c->h = nh; |
115
329fd7dae530
removed c->f{x,y,w,h} and c->t{x,y,w,h} in favor for the new rule handling remembering two kinds of geometries is unnecessary, removed the randomized (x,y) setting on dofloat startup, was kind too random und unpredictable
arg@10ksloc.org
parents:
114
diff
changeset
|
95 c->x = (ocx <= ev.xmotion.x) ? ocx : ocx - c->w; |
329fd7dae530
removed c->f{x,y,w,h} and c->t{x,y,w,h} in favor for the new rule handling remembering two kinds of geometries is unnecessary, removed the randomized (x,y) setting on dofloat startup, was kind too random und unpredictable
arg@10ksloc.org
parents:
114
diff
changeset
|
96 c->y = (ocy <= ev.xmotion.y) ? ocy : ocy - c->h; |
105 | 97 if(ocx <= ev.xmotion.x) |
98 sticky = (ocy <= ev.xmotion.y) ? TopLeft : BotLeft; | |
99 else | |
100 sticky = (ocy <= ev.xmotion.y) ? TopRight : BotRight; | |
99
a19556fe83b5
applied Sanders resize patch, fixed lower bug
arg@10ksloc.org
parents:
95
diff
changeset
|
101 resize(c, True, sticky); |
77 | 102 break; |
103 } | |
104 } | |
105 } | |
73 | 106 |
107 static void | |
461
9d23330a5268
removed a bunch of lines through making function signatures more consistent with my style ( { does not belong to a new line, if function args are single-lined)
Anselm R. Garbe <arg@10kloc.org>
parents:
454
diff
changeset
|
108 buttonpress(XEvent *e) { |
73 | 109 int x; |
110 Arg a; | |
123 | 111 Client *c; |
18
1efa34c6e1b6
added mouse-based resizals
Anselm R. Garbe <garbeam@wmii.de>
parents:
16
diff
changeset
|
112 XButtonPressedEvent *ev = &e->xbutton; |
1efa34c6e1b6
added mouse-based resizals
Anselm R. Garbe <garbeam@wmii.de>
parents:
16
diff
changeset
|
113 |
73 | 114 if(barwin == ev->window) { |
362
ba6c55e1b9b2
trying a different configuration
Anselm R. Garbe <arg@10kloc.org>
parents:
356
diff
changeset
|
115 x = 0; |
ba6c55e1b9b2
trying a different configuration
Anselm R. Garbe <arg@10kloc.org>
parents:
356
diff
changeset
|
116 for(a.i = 0; a.i < ntags; a.i++) { |
ba6c55e1b9b2
trying a different configuration
Anselm R. Garbe <arg@10kloc.org>
parents:
356
diff
changeset
|
117 x += textw(tags[a.i]); |
ba6c55e1b9b2
trying a different configuration
Anselm R. Garbe <arg@10kloc.org>
parents:
356
diff
changeset
|
118 if(ev->x < x) { |
399 | 119 if(ev->button == Button1) { |
398 | 120 if(ev->state & MODKEY) |
121 tag(&a); | |
122 else | |
123 view(&a); | |
399 | 124 } |
125 else if(ev->button == Button3) { | |
398 | 126 if(ev->state & MODKEY) |
127 toggletag(&a); | |
128 else | |
129 toggleview(&a); | |
394
1da9a6b94ca9
implemented Button2 press on tags for toggletag on the focused client
Anselm R. Garbe <arg@10kloc.org>
parents:
387
diff
changeset
|
130 } |
362
ba6c55e1b9b2
trying a different configuration
Anselm R. Garbe <arg@10kloc.org>
parents:
356
diff
changeset
|
131 return; |
73 | 132 } |
133 } | |
676
7672a1041218
added comment to %u in config.default.h, added Button{4.5} support on mode label
Anselm R. Garbe <arg@suckless.org>
parents:
647
diff
changeset
|
134 if(ev->x < x + bmw) |
7672a1041218
added comment to %u in config.default.h, added Button{4.5} support on mode label
Anselm R. Garbe <arg@suckless.org>
parents:
647
diff
changeset
|
135 switch(ev->button) { |
7672a1041218
added comment to %u in config.default.h, added Button{4.5} support on mode label
Anselm R. Garbe <arg@suckless.org>
parents:
647
diff
changeset
|
136 case Button1: |
7672a1041218
added comment to %u in config.default.h, added Button{4.5} support on mode label
Anselm R. Garbe <arg@suckless.org>
parents:
647
diff
changeset
|
137 togglemode(NULL); |
7672a1041218
added comment to %u in config.default.h, added Button{4.5} support on mode label
Anselm R. Garbe <arg@suckless.org>
parents:
647
diff
changeset
|
138 break; |
7672a1041218
added comment to %u in config.default.h, added Button{4.5} support on mode label
Anselm R. Garbe <arg@suckless.org>
parents:
647
diff
changeset
|
139 case Button4: |
7672a1041218
added comment to %u in config.default.h, added Button{4.5} support on mode label
Anselm R. Garbe <arg@suckless.org>
parents:
647
diff
changeset
|
140 a.i = 1; |
7672a1041218
added comment to %u in config.default.h, added Button{4.5} support on mode label
Anselm R. Garbe <arg@suckless.org>
parents:
647
diff
changeset
|
141 incnmaster(&a); |
7672a1041218
added comment to %u in config.default.h, added Button{4.5} support on mode label
Anselm R. Garbe <arg@suckless.org>
parents:
647
diff
changeset
|
142 break; |
7672a1041218
added comment to %u in config.default.h, added Button{4.5} support on mode label
Anselm R. Garbe <arg@suckless.org>
parents:
647
diff
changeset
|
143 case Button5: |
7672a1041218
added comment to %u in config.default.h, added Button{4.5} support on mode label
Anselm R. Garbe <arg@suckless.org>
parents:
647
diff
changeset
|
144 a.i = -1; |
7672a1041218
added comment to %u in config.default.h, added Button{4.5} support on mode label
Anselm R. Garbe <arg@suckless.org>
parents:
647
diff
changeset
|
145 incnmaster(&a); |
7672a1041218
added comment to %u in config.default.h, added Button{4.5} support on mode label
Anselm R. Garbe <arg@suckless.org>
parents:
647
diff
changeset
|
146 break; |
7672a1041218
added comment to %u in config.default.h, added Button{4.5} support on mode label
Anselm R. Garbe <arg@suckless.org>
parents:
647
diff
changeset
|
147 } |
73 | 148 } |
58
1269bd127551
made barclick to select the specific tag
Anselm R. Garbe <garbeam@wmii.de>
parents:
55
diff
changeset
|
149 else if((c = getclient(ev->window))) { |
143 | 150 focus(c); |
473
2d8af0d7920d
implemented the maximization as I described on the mailinglist, this feels better to me.
arg@mmvi
parents:
466
diff
changeset
|
151 if(CLEANMASK(ev->state) != MODKEY) |
318
1b45d6f14fca
applied Sanders focus_* patches, removed the unnecessary clean-prefix from the new function names
Anselm R.Garbe <arg@10ksloc.org>
parents:
292
diff
changeset
|
152 return; |
400
052657ff2e7b
applied Sanders max_and_focus.patch
Anselm R. Garbe <arg@10kloc.org>
parents:
399
diff
changeset
|
153 if(ev->button == Button1 && (arrange == dofloat || c->isfloat)) { |
487 | 154 restack(); |
399 | 155 movemouse(c); |
156 } | |
157 else if(ev->button == Button2) | |
248
1227c21588e2
applied Sanders zoom_update patch
Anselm R.Garbe <arg@10ksloc.org>
parents:
239
diff
changeset
|
158 zoom(NULL); |
550 | 159 else if(ev->button == Button3 && (arrange == dofloat || c->isfloat) && |
160 !c->isfixed) { | |
487 | 161 restack(); |
399 | 162 resizemouse(c); |
18
1efa34c6e1b6
added mouse-based resizals
Anselm R. Garbe <garbeam@wmii.de>
parents:
16
diff
changeset
|
163 } |
1efa34c6e1b6
added mouse-based resizals
Anselm R. Garbe <garbeam@wmii.de>
parents:
16
diff
changeset
|
164 } |
1efa34c6e1b6
added mouse-based resizals
Anselm R. Garbe <garbeam@wmii.de>
parents:
16
diff
changeset
|
165 } |
1efa34c6e1b6
added mouse-based resizals
Anselm R. Garbe <garbeam@wmii.de>
parents:
16
diff
changeset
|
166 |
1efa34c6e1b6
added mouse-based resizals
Anselm R. Garbe <garbeam@wmii.de>
parents:
16
diff
changeset
|
167 static void |
461
9d23330a5268
removed a bunch of lines through making function signatures more consistent with my style ( { does not belong to a new line, if function args are single-lined)
Anselm R. Garbe <arg@10kloc.org>
parents:
454
diff
changeset
|
168 configurerequest(XEvent *e) { |
286 | 169 unsigned long newmask; |
123 | 170 Client *c; |
5 | 171 XConfigureRequestEvent *ev = &e->xconfigurerequest; |
172 XWindowChanges wc; | |
173 | |
18
1efa34c6e1b6
added mouse-based resizals
Anselm R. Garbe <garbeam@wmii.de>
parents:
16
diff
changeset
|
174 if((c = getclient(ev->window))) { |
488 | 175 c->ismax = False; |
195
97960220eb77
fixed xterm font change (all other related apps should work fine with this fix as well)
arg@10ksloc.org
parents:
178
diff
changeset
|
176 if(ev->value_mask & CWX) |
97960220eb77
fixed xterm font change (all other related apps should work fine with this fix as well)
arg@10ksloc.org
parents:
178
diff
changeset
|
177 c->x = ev->x; |
97960220eb77
fixed xterm font change (all other related apps should work fine with this fix as well)
arg@10ksloc.org
parents:
178
diff
changeset
|
178 if(ev->value_mask & CWY) |
97960220eb77
fixed xterm font change (all other related apps should work fine with this fix as well)
arg@10ksloc.org
parents:
178
diff
changeset
|
179 c->y = ev->y; |
97960220eb77
fixed xterm font change (all other related apps should work fine with this fix as well)
arg@10ksloc.org
parents:
178
diff
changeset
|
180 if(ev->value_mask & CWWidth) |
97960220eb77
fixed xterm font change (all other related apps should work fine with this fix as well)
arg@10ksloc.org
parents:
178
diff
changeset
|
181 c->w = ev->width; |
97960220eb77
fixed xterm font change (all other related apps should work fine with this fix as well)
arg@10ksloc.org
parents:
178
diff
changeset
|
182 if(ev->value_mask & CWHeight) |
97960220eb77
fixed xterm font change (all other related apps should work fine with this fix as well)
arg@10ksloc.org
parents:
178
diff
changeset
|
183 c->h = ev->height; |
29 | 184 if(ev->value_mask & CWBorderWidth) |
164
21071ae1fe68
made fullscreen apps working fine in floating mode (there is no sane way to make them work in tiled mode, thus I switch to floating mode if I run such kind of app), also fixed the xterm issue reported by Sander
arg@10ksloc.org
parents:
163
diff
changeset
|
185 c->border = ev->border_width; |
21071ae1fe68
made fullscreen apps working fine in floating mode (there is no sane way to make them work in tiled mode, thus I switch to floating mode if I run such kind of app), also fixed the xterm issue reported by Sander
arg@10ksloc.org
parents:
163
diff
changeset
|
186 wc.x = c->x; |
21071ae1fe68
made fullscreen apps working fine in floating mode (there is no sane way to make them work in tiled mode, thus I switch to floating mode if I run such kind of app), also fixed the xterm issue reported by Sander
arg@10ksloc.org
parents:
163
diff
changeset
|
187 wc.y = c->y; |
21071ae1fe68
made fullscreen apps working fine in floating mode (there is no sane way to make them work in tiled mode, thus I switch to floating mode if I run such kind of app), also fixed the xterm issue reported by Sander
arg@10ksloc.org
parents:
163
diff
changeset
|
188 wc.width = c->w; |
21071ae1fe68
made fullscreen apps working fine in floating mode (there is no sane way to make them work in tiled mode, thus I switch to floating mode if I run such kind of app), also fixed the xterm issue reported by Sander
arg@10ksloc.org
parents:
163
diff
changeset
|
189 wc.height = c->h; |
21071ae1fe68
made fullscreen apps working fine in floating mode (there is no sane way to make them work in tiled mode, thus I switch to floating mode if I run such kind of app), also fixed the xterm issue reported by Sander
arg@10ksloc.org
parents:
163
diff
changeset
|
190 newmask = ev->value_mask & (~(CWSibling | CWStackMode | CWBorderWidth)); |
21071ae1fe68
made fullscreen apps working fine in floating mode (there is no sane way to make them work in tiled mode, thus I switch to floating mode if I run such kind of app), also fixed the xterm issue reported by Sander
arg@10ksloc.org
parents:
163
diff
changeset
|
191 if(newmask) |
21071ae1fe68
made fullscreen apps working fine in floating mode (there is no sane way to make them work in tiled mode, thus I switch to floating mode if I run such kind of app), also fixed the xterm issue reported by Sander
arg@10ksloc.org
parents:
163
diff
changeset
|
192 XConfigureWindow(dpy, c->win, newmask, &wc); |
491
12395ef46d97
added configure(), but this doesn't really fix those frking broken SDL apps
arg@mmvi
parents:
490
diff
changeset
|
193 else |
12395ef46d97
added configure(), but this doesn't really fix those frking broken SDL apps
arg@mmvi
parents:
490
diff
changeset
|
194 configure(c); |
195
97960220eb77
fixed xterm font change (all other related apps should work fine with this fix as well)
arg@10ksloc.org
parents:
178
diff
changeset
|
195 XSync(dpy, False); |
505
2c29d74b11dc
first step to a more flexible dotile() algorithm
Anselm R. Garbe <arg@10kloc.org>
parents:
500
diff
changeset
|
196 if(c->isfloat) { |
508
ede48935f2b3
added the new dotile as described on ml
Anselm R. Garbe <arg@10kloc.org>
parents:
506
diff
changeset
|
197 resize(c, False, TopLeft); |
ede48935f2b3
added the new dotile as described on ml
Anselm R. Garbe <arg@10kloc.org>
parents:
506
diff
changeset
|
198 if(!isvisible(c)) |
687
a76799907854
removed client title bar
Anselm R. Garbe <arg@suckless.org>
parents:
676
diff
changeset
|
199 XMoveWindow(dpy, c->win, c->x + 2 * sw, c->y); |
505
2c29d74b11dc
first step to a more flexible dotile() algorithm
Anselm R. Garbe <arg@10kloc.org>
parents:
500
diff
changeset
|
200 } |
196 | 201 else |
533
a5567a0d3011
do* has no Arg arument anymore (never called directly)
Anselm R. Garbe <arg@10kloc.org>
parents:
532
diff
changeset
|
202 arrange(); |
164
21071ae1fe68
made fullscreen apps working fine in floating mode (there is no sane way to make them work in tiled mode, thus I switch to floating mode if I run such kind of app), also fixed the xterm issue reported by Sander
arg@10ksloc.org
parents:
163
diff
changeset
|
203 } |
21071ae1fe68
made fullscreen apps working fine in floating mode (there is no sane way to make them work in tiled mode, thus I switch to floating mode if I run such kind of app), also fixed the xterm issue reported by Sander
arg@10ksloc.org
parents:
163
diff
changeset
|
204 else { |
21071ae1fe68
made fullscreen apps working fine in floating mode (there is no sane way to make them work in tiled mode, thus I switch to floating mode if I run such kind of app), also fixed the xterm issue reported by Sander
arg@10ksloc.org
parents:
163
diff
changeset
|
205 wc.x = ev->x; |
21071ae1fe68
made fullscreen apps working fine in floating mode (there is no sane way to make them work in tiled mode, thus I switch to floating mode if I run such kind of app), also fixed the xterm issue reported by Sander
arg@10ksloc.org
parents:
163
diff
changeset
|
206 wc.y = ev->y; |
21071ae1fe68
made fullscreen apps working fine in floating mode (there is no sane way to make them work in tiled mode, thus I switch to floating mode if I run such kind of app), also fixed the xterm issue reported by Sander
arg@10ksloc.org
parents:
163
diff
changeset
|
207 wc.width = ev->width; |
21071ae1fe68
made fullscreen apps working fine in floating mode (there is no sane way to make them work in tiled mode, thus I switch to floating mode if I run such kind of app), also fixed the xterm issue reported by Sander
arg@10ksloc.org
parents:
163
diff
changeset
|
208 wc.height = ev->height; |
21071ae1fe68
made fullscreen apps working fine in floating mode (there is no sane way to make them work in tiled mode, thus I switch to floating mode if I run such kind of app), also fixed the xterm issue reported by Sander
arg@10ksloc.org
parents:
163
diff
changeset
|
209 wc.border_width = ev->border_width; |
21071ae1fe68
made fullscreen apps working fine in floating mode (there is no sane way to make them work in tiled mode, thus I switch to floating mode if I run such kind of app), also fixed the xterm issue reported by Sander
arg@10ksloc.org
parents:
163
diff
changeset
|
210 wc.sibling = ev->above; |
21071ae1fe68
made fullscreen apps working fine in floating mode (there is no sane way to make them work in tiled mode, thus I switch to floating mode if I run such kind of app), also fixed the xterm issue reported by Sander
arg@10ksloc.org
parents:
163
diff
changeset
|
211 wc.stack_mode = ev->detail; |
21071ae1fe68
made fullscreen apps working fine in floating mode (there is no sane way to make them work in tiled mode, thus I switch to floating mode if I run such kind of app), also fixed the xterm issue reported by Sander
arg@10ksloc.org
parents:
163
diff
changeset
|
212 XConfigureWindow(dpy, ev->window, ev->value_mask, &wc); |
195
97960220eb77
fixed xterm font change (all other related apps should work fine with this fix as well)
arg@10ksloc.org
parents:
178
diff
changeset
|
213 XSync(dpy, False); |
164
21071ae1fe68
made fullscreen apps working fine in floating mode (there is no sane way to make them work in tiled mode, thus I switch to floating mode if I run such kind of app), also fixed the xterm issue reported by Sander
arg@10ksloc.org
parents:
163
diff
changeset
|
214 } |
5 | 215 } |
216 | |
217 static void | |
461
9d23330a5268
removed a bunch of lines through making function signatures more consistent with my style ( { does not belong to a new line, if function args are single-lined)
Anselm R. Garbe <arg@10kloc.org>
parents:
454
diff
changeset
|
218 destroynotify(XEvent *e) { |
5 | 219 Client *c; |
220 XDestroyWindowEvent *ev = &e->xdestroywindow; | |
221 | |
11 | 222 if((c = getclient(ev->window))) |
223 unmanage(c); | |
5 | 224 } |
225 | |
226 static void | |
461
9d23330a5268
removed a bunch of lines through making function signatures more consistent with my style ( { does not belong to a new line, if function args are single-lined)
Anselm R. Garbe <arg@10kloc.org>
parents:
454
diff
changeset
|
227 enternotify(XEvent *e) { |
123 | 228 Client *c; |
5 | 229 XCrossingEvent *ev = &e->xcrossing; |
230 | |
232
98e9901b1dbb
disallow zoom on maximized clients
Anselm R.Garbe <arg@10ksloc.org>
parents:
231
diff
changeset
|
231 if(ev->mode != NotifyNormal || ev->detail == NotifyInferior) |
5 | 232 return; |
687
a76799907854
removed client title bar
Anselm R. Garbe <arg@suckless.org>
parents:
676
diff
changeset
|
233 if((c = getclient(ev->window)) && isvisible(c)) |
13
5cc5e55a132d
added protocol killing stuff
Anselm R. Garbe <garbeam@wmii.de>
parents:
11
diff
changeset
|
234 focus(c); |
239
e5390f8e06b9
applied sumik's multihead patch
Anselm R.Garbe <arg@10ksloc.org>
parents:
238
diff
changeset
|
235 else if(ev->window == root) { |
31 | 236 issel = True; |
707
c3c57faef013
leavenotify also don't needs the check
Anselm R. Garbe <arg@suckless.org>
parents:
706
diff
changeset
|
237 focus(sel); |
239
e5390f8e06b9
applied sumik's multihead patch
Anselm R.Garbe <arg@10ksloc.org>
parents:
238
diff
changeset
|
238 } |
5 | 239 } |
240 | |
241 static void | |
461
9d23330a5268
removed a bunch of lines through making function signatures more consistent with my style ( { does not belong to a new line, if function args are single-lined)
Anselm R. Garbe <arg@10kloc.org>
parents:
454
diff
changeset
|
242 expose(XEvent *e) { |
5 | 243 XExposeEvent *ev = &e->xexpose; |
244 | |
245 if(ev->count == 0) { | |
70 | 246 if(barwin == ev->window) |
74 | 247 drawstatus(); |
5 | 248 } |
249 } | |
250 | |
251 static void | |
461
9d23330a5268
removed a bunch of lines through making function signatures more consistent with my style ( { does not belong to a new line, if function args are single-lined)
Anselm R. Garbe <arg@10kloc.org>
parents:
454
diff
changeset
|
252 keypress(XEvent *e) { |
581
601842ee4484
applied Jukka's sizeof K&R compliance patch, applied Manuels' last-line printage proposal for stdin reading.
arg@mig29
parents:
565
diff
changeset
|
253 static unsigned int len = sizeof key / sizeof key[0]; |
589 | 254 unsigned int i; |
76
4bd49f404f10
proceeded with cleaning up, sorting functions, etc
Anselm R. Garbe <garbeam@wmii.de>
parents:
75
diff
changeset
|
255 KeySym keysym; |
123 | 256 XKeyEvent *ev = &e->xkey; |
76
4bd49f404f10
proceeded with cleaning up, sorting functions, etc
Anselm R. Garbe <garbeam@wmii.de>
parents:
75
diff
changeset
|
257 |
4bd49f404f10
proceeded with cleaning up, sorting functions, etc
Anselm R. Garbe <garbeam@wmii.de>
parents:
75
diff
changeset
|
258 keysym = XKeycodeToKeysym(dpy, (KeyCode)ev->keycode, 0); |
275 | 259 for(i = 0; i < len; i++) { |
461
9d23330a5268
removed a bunch of lines through making function signatures more consistent with my style ( { does not belong to a new line, if function args are single-lined)
Anselm R. Garbe <arg@10kloc.org>
parents:
454
diff
changeset
|
260 if(keysym == key[i].keysym |
9d23330a5268
removed a bunch of lines through making function signatures more consistent with my style ( { does not belong to a new line, if function args are single-lined)
Anselm R. Garbe <arg@10kloc.org>
parents:
454
diff
changeset
|
261 && CLEANMASK(key[i].mod) == CLEANMASK(ev->state)) |
275 | 262 { |
589 | 263 if(key[i].func) |
264 key[i].func(&key[i].arg); | |
76
4bd49f404f10
proceeded with cleaning up, sorting functions, etc
Anselm R. Garbe <garbeam@wmii.de>
parents:
75
diff
changeset
|
265 } |
275 | 266 } |
76
4bd49f404f10
proceeded with cleaning up, sorting functions, etc
Anselm R. Garbe <garbeam@wmii.de>
parents:
75
diff
changeset
|
267 } |
4bd49f404f10
proceeded with cleaning up, sorting functions, etc
Anselm R. Garbe <garbeam@wmii.de>
parents:
75
diff
changeset
|
268 |
4bd49f404f10
proceeded with cleaning up, sorting functions, etc
Anselm R. Garbe <garbeam@wmii.de>
parents:
75
diff
changeset
|
269 static void |
461
9d23330a5268
removed a bunch of lines through making function signatures more consistent with my style ( { does not belong to a new line, if function args are single-lined)
Anselm R. Garbe <arg@10kloc.org>
parents:
454
diff
changeset
|
270 leavenotify(XEvent *e) { |
76
4bd49f404f10
proceeded with cleaning up, sorting functions, etc
Anselm R. Garbe <garbeam@wmii.de>
parents:
75
diff
changeset
|
271 XCrossingEvent *ev = &e->xcrossing; |
4bd49f404f10
proceeded with cleaning up, sorting functions, etc
Anselm R. Garbe <garbeam@wmii.de>
parents:
75
diff
changeset
|
272 |
701
fc5b982778df
applied a modified version of Christof Musik's multihead patch (though this is not sure if it works in all cases, have to wait for an ACK by Christof)
Anselm R. Garbe <arg@suckless.org>
parents:
692
diff
changeset
|
273 if((ev->window == root) && !ev->same_screen) { |
707
c3c57faef013
leavenotify also don't needs the check
Anselm R. Garbe <arg@suckless.org>
parents:
706
diff
changeset
|
274 focus(NULL); |
239
e5390f8e06b9
applied sumik's multihead patch
Anselm R.Garbe <arg@10ksloc.org>
parents:
238
diff
changeset
|
275 issel = False; |
701
fc5b982778df
applied a modified version of Christof Musik's multihead patch (though this is not sure if it works in all cases, have to wait for an ACK by Christof)
Anselm R. Garbe <arg@suckless.org>
parents:
692
diff
changeset
|
276 } |
76
4bd49f404f10
proceeded with cleaning up, sorting functions, etc
Anselm R. Garbe <garbeam@wmii.de>
parents:
75
diff
changeset
|
277 } |
4bd49f404f10
proceeded with cleaning up, sorting functions, etc
Anselm R. Garbe <garbeam@wmii.de>
parents:
75
diff
changeset
|
278 |
4bd49f404f10
proceeded with cleaning up, sorting functions, etc
Anselm R. Garbe <garbeam@wmii.de>
parents:
75
diff
changeset
|
279 static void |
461
9d23330a5268
removed a bunch of lines through making function signatures more consistent with my style ( { does not belong to a new line, if function args are single-lined)
Anselm R. Garbe <arg@10kloc.org>
parents:
454
diff
changeset
|
280 mappingnotify(XEvent *e) { |
279
2cedfbefd025
added mappingnotify event for kb refreshes
Anselm R.Garbe <arg@10ksloc.org>
parents:
278
diff
changeset
|
281 XMappingEvent *ev = &e->xmapping; |
2cedfbefd025
added mappingnotify event for kb refreshes
Anselm R.Garbe <arg@10ksloc.org>
parents:
278
diff
changeset
|
282 |
2cedfbefd025
added mappingnotify event for kb refreshes
Anselm R.Garbe <arg@10ksloc.org>
parents:
278
diff
changeset
|
283 XRefreshKeyboardMapping(ev); |
2cedfbefd025
added mappingnotify event for kb refreshes
Anselm R.Garbe <arg@10ksloc.org>
parents:
278
diff
changeset
|
284 if(ev->request == MappingKeyboard) |
2cedfbefd025
added mappingnotify event for kb refreshes
Anselm R.Garbe <arg@10ksloc.org>
parents:
278
diff
changeset
|
285 grabkeys(); |
2cedfbefd025
added mappingnotify event for kb refreshes
Anselm R.Garbe <arg@10ksloc.org>
parents:
278
diff
changeset
|
286 } |
2cedfbefd025
added mappingnotify event for kb refreshes
Anselm R.Garbe <arg@10ksloc.org>
parents:
278
diff
changeset
|
287 |
2cedfbefd025
added mappingnotify event for kb refreshes
Anselm R.Garbe <arg@10ksloc.org>
parents:
278
diff
changeset
|
288 static void |
461
9d23330a5268
removed a bunch of lines through making function signatures more consistent with my style ( { does not belong to a new line, if function args are single-lined)
Anselm R. Garbe <arg@10kloc.org>
parents:
454
diff
changeset
|
289 maprequest(XEvent *e) { |
123 | 290 static XWindowAttributes wa; |
5 | 291 XMapRequestEvent *ev = &e->xmaprequest; |
292 | |
293 if(!XGetWindowAttributes(dpy, ev->window, &wa)) | |
294 return; | |
295 if(wa.override_redirect) { | |
296 XSelectInput(dpy, ev->window, | |
297 (StructureNotifyMask | PropertyChangeMask)); | |
298 return; | |
299 } | |
10
703255003abb
changed how manage client works
Anselm R. Garbe <garbeam@wmii.de>
parents:
9
diff
changeset
|
300 if(!getclient(ev->window)) |
703255003abb
changed how manage client works
Anselm R. Garbe <garbeam@wmii.de>
parents:
9
diff
changeset
|
301 manage(ev->window, &wa); |
5 | 302 } |
303 | |
304 static void | |
461
9d23330a5268
removed a bunch of lines through making function signatures more consistent with my style ( { does not belong to a new line, if function args are single-lined)
Anselm R. Garbe <arg@10kloc.org>
parents:
454
diff
changeset
|
305 propertynotify(XEvent *e) { |
123 | 306 Client *c; |
53 | 307 Window trans; |
123 | 308 XPropertyEvent *ev = &e->xproperty; |
5 | 309 |
310 if(ev->state == PropertyDelete) | |
311 return; /* ignore */ | |
13
5cc5e55a132d
added protocol killing stuff
Anselm R. Garbe <garbeam@wmii.de>
parents:
11
diff
changeset
|
312 if((c = getclient(ev->window))) { |
77 | 313 if(ev->atom == wmatom[WMProtocols]) { |
75 | 314 c->proto = getproto(c->win); |
30
2e0fb4130bfb
new stuff, fixed several issues
Anselm R. Garbe <garbeam@wmii.de>
parents:
29
diff
changeset
|
315 return; |
2e0fb4130bfb
new stuff, fixed several issues
Anselm R. Garbe <garbeam@wmii.de>
parents:
29
diff
changeset
|
316 } |
13
5cc5e55a132d
added protocol killing stuff
Anselm R. Garbe <garbeam@wmii.de>
parents:
11
diff
changeset
|
317 switch (ev->atom) { |
5cc5e55a132d
added protocol killing stuff
Anselm R. Garbe <garbeam@wmii.de>
parents:
11
diff
changeset
|
318 default: break; |
5cc5e55a132d
added protocol killing stuff
Anselm R. Garbe <garbeam@wmii.de>
parents:
11
diff
changeset
|
319 case XA_WM_TRANSIENT_FOR: |
53 | 320 XGetTransientForHint(dpy, c->win, &trans); |
80
8125f908c80c
several additions in mouse handling ;)
Anselm R. Garbe <garbeam@wmii.de>
parents:
79
diff
changeset
|
321 if(!c->isfloat && (c->isfloat = (trans != 0))) |
533
a5567a0d3011
do* has no Arg arument anymore (never called directly)
Anselm R. Garbe <arg@10kloc.org>
parents:
532
diff
changeset
|
322 arrange(); |
13
5cc5e55a132d
added protocol killing stuff
Anselm R. Garbe <garbeam@wmii.de>
parents:
11
diff
changeset
|
323 break; |
5cc5e55a132d
added protocol killing stuff
Anselm R. Garbe <garbeam@wmii.de>
parents:
11
diff
changeset
|
324 case XA_WM_NORMAL_HINTS: |
639
226ef912c093
renamed updatesize into updatesizehints (thx to Sander for this hint)
arg@mig29
parents:
630
diff
changeset
|
325 updatesizehints(c); |
13
5cc5e55a132d
added protocol killing stuff
Anselm R. Garbe <garbeam@wmii.de>
parents:
11
diff
changeset
|
326 break; |
5cc5e55a132d
added protocol killing stuff
Anselm R. Garbe <garbeam@wmii.de>
parents:
11
diff
changeset
|
327 } |
77 | 328 if(ev->atom == XA_WM_NAME || ev->atom == netatom[NetWMName]) { |
454
ffb462fb7903
small change to comments, renamed two set* functions in client.c into update*
Anselm R. Garbe <arg@10kloc.org>
parents:
400
diff
changeset
|
329 updatetitle(c); |
690
399f08187c27
removed drawclient and drawall (they performed useless operations/consumed useless cpu cycles)
Anselm R. Garbe <arg@suckless.org>
parents:
687
diff
changeset
|
330 if(c == sel) |
399f08187c27
removed drawclient and drawall (they performed useless operations/consumed useless cpu cycles)
Anselm R. Garbe <arg@suckless.org>
parents:
687
diff
changeset
|
331 drawstatus(); |
13
5cc5e55a132d
added protocol killing stuff
Anselm R. Garbe <garbeam@wmii.de>
parents:
11
diff
changeset
|
332 } |
5cc5e55a132d
added protocol killing stuff
Anselm R. Garbe <garbeam@wmii.de>
parents:
11
diff
changeset
|
333 } |
5 | 334 } |
335 | |
336 static void | |
461
9d23330a5268
removed a bunch of lines through making function signatures more consistent with my style ( { does not belong to a new line, if function args are single-lined)
Anselm R. Garbe <arg@10kloc.org>
parents:
454
diff
changeset
|
337 unmapnotify(XEvent *e) { |
5 | 338 Client *c; |
339 XUnmapEvent *ev = &e->xunmap; | |
340 | |
10
703255003abb
changed how manage client works
Anselm R. Garbe <garbeam@wmii.de>
parents:
9
diff
changeset
|
341 if((c = getclient(ev->window))) |
703255003abb
changed how manage client works
Anselm R. Garbe <garbeam@wmii.de>
parents:
9
diff
changeset
|
342 unmanage(c); |
5 | 343 } |
76
4bd49f404f10
proceeded with cleaning up, sorting functions, etc
Anselm R. Garbe <garbeam@wmii.de>
parents:
75
diff
changeset
|
344 |
84
052fe7498930
ordered variables in structs and source files alphabetically
Anselm R. Garbe <garbeam@wmii.de>
parents:
80
diff
changeset
|
345 /* extern */ |
76
4bd49f404f10
proceeded with cleaning up, sorting functions, etc
Anselm R. Garbe <garbeam@wmii.de>
parents:
75
diff
changeset
|
346 |
4bd49f404f10
proceeded with cleaning up, sorting functions, etc
Anselm R. Garbe <garbeam@wmii.de>
parents:
75
diff
changeset
|
347 void (*handler[LASTEvent]) (XEvent *) = { |
4bd49f404f10
proceeded with cleaning up, sorting functions, etc
Anselm R. Garbe <garbeam@wmii.de>
parents:
75
diff
changeset
|
348 [ButtonPress] = buttonpress, |
4bd49f404f10
proceeded with cleaning up, sorting functions, etc
Anselm R. Garbe <garbeam@wmii.de>
parents:
75
diff
changeset
|
349 [ConfigureRequest] = configurerequest, |
4bd49f404f10
proceeded with cleaning up, sorting functions, etc
Anselm R. Garbe <garbeam@wmii.de>
parents:
75
diff
changeset
|
350 [DestroyNotify] = destroynotify, |
4bd49f404f10
proceeded with cleaning up, sorting functions, etc
Anselm R. Garbe <garbeam@wmii.de>
parents:
75
diff
changeset
|
351 [EnterNotify] = enternotify, |
4bd49f404f10
proceeded with cleaning up, sorting functions, etc
Anselm R. Garbe <garbeam@wmii.de>
parents:
75
diff
changeset
|
352 [LeaveNotify] = leavenotify, |
4bd49f404f10
proceeded with cleaning up, sorting functions, etc
Anselm R. Garbe <garbeam@wmii.de>
parents:
75
diff
changeset
|
353 [Expose] = expose, |
4bd49f404f10
proceeded with cleaning up, sorting functions, etc
Anselm R. Garbe <garbeam@wmii.de>
parents:
75
diff
changeset
|
354 [KeyPress] = keypress, |
279
2cedfbefd025
added mappingnotify event for kb refreshes
Anselm R.Garbe <arg@10ksloc.org>
parents:
278
diff
changeset
|
355 [MappingNotify] = mappingnotify, |
76
4bd49f404f10
proceeded with cleaning up, sorting functions, etc
Anselm R. Garbe <garbeam@wmii.de>
parents:
75
diff
changeset
|
356 [MapRequest] = maprequest, |
4bd49f404f10
proceeded with cleaning up, sorting functions, etc
Anselm R. Garbe <garbeam@wmii.de>
parents:
75
diff
changeset
|
357 [PropertyNotify] = propertynotify, |
4bd49f404f10
proceeded with cleaning up, sorting functions, etc
Anselm R. Garbe <garbeam@wmii.de>
parents:
75
diff
changeset
|
358 [UnmapNotify] = unmapnotify |
4bd49f404f10
proceeded with cleaning up, sorting functions, etc
Anselm R. Garbe <garbeam@wmii.de>
parents:
75
diff
changeset
|
359 }; |
4bd49f404f10
proceeded with cleaning up, sorting functions, etc
Anselm R. Garbe <garbeam@wmii.de>
parents:
75
diff
changeset
|
360 |
4bd49f404f10
proceeded with cleaning up, sorting functions, etc
Anselm R. Garbe <garbeam@wmii.de>
parents:
75
diff
changeset
|
361 void |
487 | 362 grabkeys(void) { |
581
601842ee4484
applied Jukka's sizeof K&R compliance patch, applied Manuels' last-line printage proposal for stdin reading.
arg@mig29
parents:
565
diff
changeset
|
363 static unsigned int len = sizeof key / sizeof key[0]; |
76
4bd49f404f10
proceeded with cleaning up, sorting functions, etc
Anselm R. Garbe <garbeam@wmii.de>
parents:
75
diff
changeset
|
364 unsigned int i; |
4bd49f404f10
proceeded with cleaning up, sorting functions, etc
Anselm R. Garbe <garbeam@wmii.de>
parents:
75
diff
changeset
|
365 KeyCode code; |
4bd49f404f10
proceeded with cleaning up, sorting functions, etc
Anselm R. Garbe <garbeam@wmii.de>
parents:
75
diff
changeset
|
366 |
279
2cedfbefd025
added mappingnotify event for kb refreshes
Anselm R.Garbe <arg@10ksloc.org>
parents:
278
diff
changeset
|
367 XUngrabKey(dpy, AnyKey, AnyModifier, root); |
76
4bd49f404f10
proceeded with cleaning up, sorting functions, etc
Anselm R. Garbe <garbeam@wmii.de>
parents:
75
diff
changeset
|
368 for(i = 0; i < len; i++) { |
4bd49f404f10
proceeded with cleaning up, sorting functions, etc
Anselm R. Garbe <garbeam@wmii.de>
parents:
75
diff
changeset
|
369 code = XKeysymToKeycode(dpy, key[i].keysym); |
4bd49f404f10
proceeded with cleaning up, sorting functions, etc
Anselm R. Garbe <garbeam@wmii.de>
parents:
75
diff
changeset
|
370 XGrabKey(dpy, code, key[i].mod, root, True, |
4bd49f404f10
proceeded with cleaning up, sorting functions, etc
Anselm R. Garbe <garbeam@wmii.de>
parents:
75
diff
changeset
|
371 GrabModeAsync, GrabModeAsync); |
160 | 372 XGrabKey(dpy, code, key[i].mod | LockMask, root, True, |
373 GrabModeAsync, GrabModeAsync); | |
291
8e6e0aa5e2ae
removed NUMLOCKMASK, added dynamically calculated numlockmask instead
Anselm R.Garbe <arg@10ksloc.org>
parents:
288
diff
changeset
|
374 XGrabKey(dpy, code, key[i].mod | numlockmask, root, True, |
146
f328ce9c558c
centralized/externalized configuration to config.h
arg@10ksloc.org
parents:
145
diff
changeset
|
375 GrabModeAsync, GrabModeAsync); |
291
8e6e0aa5e2ae
removed NUMLOCKMASK, added dynamically calculated numlockmask instead
Anselm R.Garbe <arg@10ksloc.org>
parents:
288
diff
changeset
|
376 XGrabKey(dpy, code, key[i].mod | numlockmask | LockMask, root, True, |
146
f328ce9c558c
centralized/externalized configuration to config.h
arg@10ksloc.org
parents:
145
diff
changeset
|
377 GrabModeAsync, GrabModeAsync); |
76
4bd49f404f10
proceeded with cleaning up, sorting functions, etc
Anselm R. Garbe <garbeam@wmii.de>
parents:
75
diff
changeset
|
378 } |
4bd49f404f10
proceeded with cleaning up, sorting functions, etc
Anselm R. Garbe <garbeam@wmii.de>
parents:
75
diff
changeset
|
379 } |
292 | 380 |
381 void | |
487 | 382 procevent(void) { |
292 | 383 XEvent ev; |
384 | |
385 while(XPending(dpy)) { | |
386 XNextEvent(dpy, &ev); | |
387 if(handler[ev.type]) | |
388 (handler[ev.type])(&ev); /* call handler */ | |
389 } | |
390 } |