author | Anselm R. Garbe <arg@10kloc.org> |
Wed, 06 Sep 2006 11:46:35 +0200 | |
changeset 435 | 42388f634de0 |
parent 400 | 052657ff2e7b |
child 454 | ffb462fb7903 |
permissions | -rw-r--r-- |
5 | 1 |
/* |
2 |
* (C)opyright MMVI Anselm R. Garbe <garbeam at gmail dot com> |
|
3 |
* See LICENSE file for license details. |
|
4 |
*/ |
|
76
4bd49f404f10
proceeded with cleaning up, sorting functions, etc
Anselm R. Garbe <garbeam@wmii.de>
parents:
75
diff
changeset
|
5 |
#include "dwm.h" |
5 | 6 |
#include <stdlib.h> |
7 |
#include <X11/keysym.h> |
|
13
5cc5e55a132d
added protocol killing stuff
Anselm R. Garbe <garbeam@wmii.de>
parents:
11
diff
changeset
|
8 |
#include <X11/Xatom.h> |
5 | 9 |
|
146
f328ce9c558c
centralized/externalized configuration to config.h
arg@10ksloc.org
parents:
145
diff
changeset
|
10 |
/* static */ |
114 | 11 |
|
12 |
typedef struct { |
|
13 |
unsigned long mod; |
|
14 |
KeySym keysym; |
|
15 |
void (*func)(Arg *arg); |
|
16 |
Arg arg; |
|
17 |
} Key; |
|
18 |
||
146
f328ce9c558c
centralized/externalized configuration to config.h
arg@10ksloc.org
parents:
145
diff
changeset
|
19 |
KEYS |
75 | 20 |
|
291
8e6e0aa5e2ae
removed NUMLOCKMASK, added dynamically calculated numlockmask instead
Anselm R.Garbe <arg@10ksloc.org>
parents:
288
diff
changeset
|
21 |
#define CLEANMASK(mask) (mask & ~(numlockmask | LockMask)) |
75 | 22 |
|
77 | 23 |
static void |
24 |
movemouse(Client *c) |
|
25 |
{ |
|
26 |
int x1, y1, ocx, ocy, di; |
|
27 |
unsigned int dui; |
|
28 |
Window dummy; |
|
123 | 29 |
XEvent ev; |
77 | 30 |
|
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
|
31 |
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
|
32 |
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
|
33 |
if(XGrabPointer(dpy, root, False, MOUSEMASK, GrabModeAsync, GrabModeAsync, |
123 | 34 |
None, cursor[CurMove], CurrentTime) != GrabSuccess) |
77 | 35 |
return; |
36 |
XQueryPointer(dpy, root, &dummy, &dummy, &x1, &y1, &di, &di, &dui); |
|
37 |
for(;;) { |
|
148
5267e1204367
uppercasing all define'd values (uppercase-prefixed should only be enum field qualifiers)
arg@10ksloc.org
parents:
146
diff
changeset
|
38 |
XMaskEvent(dpy, MOUSEMASK | ExposureMask, &ev); |
77 | 39 |
switch (ev.type) { |
40 |
default: break; |
|
41 |
case Expose: |
|
42 |
handler[Expose](&ev); |
|
43 |
break; |
|
44 |
case MotionNotify: |
|
79
aabebd6e61f3
fixed XSync handling and finished man page
Anselm R. Garbe <garbeam@wmii.de>
parents:
78
diff
changeset
|
45 |
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
|
46 |
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
|
47 |
c->y = ocy + (ev.xmotion.y - y1); |
99
a19556fe83b5
applied Sanders resize patch, fixed lower bug
arg@10ksloc.org
parents:
95
diff
changeset
|
48 |
resize(c, False, TopLeft); |
77 | 49 |
break; |
50 |
case ButtonRelease: |
|
51 |
XUngrabPointer(dpy, CurrentTime); |
|
52 |
return; |
|
53 |
} |
|
54 |
} |
|
55 |
} |
|
56 |
||
57 |
static void |
|
58 |
resizemouse(Client *c) |
|
59 |
{ |
|
60 |
int ocx, ocy; |
|
268
a47b3b0d7bf4
applied Sanders LD and resize patches
Anselm R.Garbe <arg@10ksloc.org>
parents:
267
diff
changeset
|
61 |
int nw, nh; |
99
a19556fe83b5
applied Sanders resize patch, fixed lower bug
arg@10ksloc.org
parents:
95
diff
changeset
|
62 |
Corner sticky; |
123 | 63 |
XEvent ev; |
77 | 64 |
|
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
|
65 |
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
|
66 |
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
|
67 |
if(XGrabPointer(dpy, root, False, MOUSEMASK, GrabModeAsync, GrabModeAsync, |
77 | 68 |
None, cursor[CurResize], CurrentTime) != GrabSuccess) |
69 |
return; |
|
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
|
70 |
XWarpPointer(dpy, None, c->win, 0, 0, 0, 0, c->w, c->h); |
77 | 71 |
for(;;) { |
148
5267e1204367
uppercasing all define'd values (uppercase-prefixed should only be enum field qualifiers)
arg@10ksloc.org
parents:
146
diff
changeset
|
72 |
XMaskEvent(dpy, MOUSEMASK | ExposureMask, &ev); |
77 | 73 |
switch(ev.type) { |
74 |
default: break; |
|
75 |
case Expose: |
|
76 |
handler[Expose](&ev); |
|
77 |
break; |
|
78 |
case MotionNotify: |
|
79
aabebd6e61f3
fixed XSync handling and finished man page
Anselm R. Garbe <garbeam@wmii.de>
parents:
78
diff
changeset
|
79 |
XSync(dpy, False); |
268
a47b3b0d7bf4
applied Sanders LD and resize patches
Anselm R.Garbe <arg@10ksloc.org>
parents:
267
diff
changeset
|
80 |
if((nw = abs(ocx - ev.xmotion.x))) |
a47b3b0d7bf4
applied Sanders LD and resize patches
Anselm R.Garbe <arg@10ksloc.org>
parents:
267
diff
changeset
|
81 |
c->w = abs(ocx - ev.xmotion.x); |
a47b3b0d7bf4
applied Sanders LD and resize patches
Anselm R.Garbe <arg@10ksloc.org>
parents:
267
diff
changeset
|
82 |
if((nh = abs(ocy - ev.xmotion.y))) |
a47b3b0d7bf4
applied Sanders LD and resize patches
Anselm R.Garbe <arg@10ksloc.org>
parents:
267
diff
changeset
|
83 |
c->h = abs(ocy - ev.xmotion.y); |
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
|
84 |
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
|
85 |
c->y = (ocy <= ev.xmotion.y) ? ocy : ocy - c->h; |
105 | 86 |
if(ocx <= ev.xmotion.x) |
87 |
sticky = (ocy <= ev.xmotion.y) ? TopLeft : BotLeft; |
|
88 |
else |
|
89 |
sticky = (ocy <= ev.xmotion.y) ? TopRight : BotRight; |
|
99
a19556fe83b5
applied Sanders resize patch, fixed lower bug
arg@10ksloc.org
parents:
95
diff
changeset
|
90 |
resize(c, True, sticky); |
77 | 91 |
break; |
92 |
case ButtonRelease: |
|
93 |
XUngrabPointer(dpy, CurrentTime); |
|
94 |
return; |
|
95 |
} |
|
96 |
} |
|
97 |
} |
|
73 | 98 |
|
99 |
static void |
|
18
1efa34c6e1b6
added mouse-based resizals
Anselm R. Garbe <garbeam@wmii.de>
parents:
16
diff
changeset
|
100 |
buttonpress(XEvent *e) |
1efa34c6e1b6
added mouse-based resizals
Anselm R. Garbe <garbeam@wmii.de>
parents:
16
diff
changeset
|
101 |
{ |
73 | 102 |
int x; |
103 |
Arg a; |
|
123 | 104 |
Client *c; |
18
1efa34c6e1b6
added mouse-based resizals
Anselm R. Garbe <garbeam@wmii.de>
parents:
16
diff
changeset
|
105 |
XButtonPressedEvent *ev = &e->xbutton; |
1efa34c6e1b6
added mouse-based resizals
Anselm R. Garbe <garbeam@wmii.de>
parents:
16
diff
changeset
|
106 |
|
73 | 107 |
if(barwin == ev->window) { |
362
ba6c55e1b9b2
trying a different configuration
Anselm R. Garbe <arg@10kloc.org>
parents:
356
diff
changeset
|
108 |
x = 0; |
ba6c55e1b9b2
trying a different configuration
Anselm R. Garbe <arg@10kloc.org>
parents:
356
diff
changeset
|
109 |
for(a.i = 0; a.i < ntags; a.i++) { |
ba6c55e1b9b2
trying a different configuration
Anselm R. Garbe <arg@10kloc.org>
parents:
356
diff
changeset
|
110 |
x += textw(tags[a.i]); |
ba6c55e1b9b2
trying a different configuration
Anselm R. Garbe <arg@10kloc.org>
parents:
356
diff
changeset
|
111 |
if(ev->x < x) { |
399 | 112 |
if(ev->button == Button1) { |
398 | 113 |
if(ev->state & MODKEY) |
114 |
tag(&a); |
|
115 |
else |
|
116 |
view(&a); |
|
399 | 117 |
} |
118 |
else if(ev->button == Button3) { |
|
398 | 119 |
if(ev->state & MODKEY) |
120 |
toggletag(&a); |
|
121 |
else |
|
122 |
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
|
123 |
} |
362
ba6c55e1b9b2
trying a different configuration
Anselm R. Garbe <arg@10kloc.org>
parents:
356
diff
changeset
|
124 |
return; |
73 | 125 |
} |
126 |
} |
|
371
fc9d35252ab4
applied sanders somepatches.patch
Anselm R. Garbe <arg@10kloc.org>
parents:
362
diff
changeset
|
127 |
if(ev->x < x + bmw) { |
fc9d35252ab4
applied sanders somepatches.patch
Anselm R. Garbe <arg@10kloc.org>
parents:
362
diff
changeset
|
128 |
if(ev->button == Button1) |
fc9d35252ab4
applied sanders somepatches.patch
Anselm R. Garbe <arg@10kloc.org>
parents:
362
diff
changeset
|
129 |
togglemode(NULL); |
fc9d35252ab4
applied sanders somepatches.patch
Anselm R. Garbe <arg@10kloc.org>
parents:
362
diff
changeset
|
130 |
} |
73 | 131 |
} |
58
1269bd127551
made barclick to select the specific tag
Anselm R. Garbe <garbeam@wmii.de>
parents:
55
diff
changeset
|
132 |
else if((c = getclient(ev->window))) { |
143 | 133 |
focus(c); |
400
052657ff2e7b
applied Sanders max_and_focus.patch
Anselm R. Garbe <arg@10kloc.org>
parents:
399
diff
changeset
|
134 |
if(maximized || 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
|
135 |
return; |
400
052657ff2e7b
applied Sanders max_and_focus.patch
Anselm R. Garbe <arg@10kloc.org>
parents:
399
diff
changeset
|
136 |
if(ev->button == Button1 && (arrange == dofloat || c->isfloat)) { |
399 | 137 |
restack(c); |
138 |
movemouse(c); |
|
139 |
} |
|
140 |
else if(ev->button == Button2) |
|
248
1227c21588e2
applied Sanders zoom_update patch
Anselm R.Garbe <arg@10ksloc.org>
parents:
239
diff
changeset
|
141 |
zoom(NULL); |
400
052657ff2e7b
applied Sanders max_and_focus.patch
Anselm R. Garbe <arg@10kloc.org>
parents:
399
diff
changeset
|
142 |
else if(ev->button == Button3 && (arrange == dofloat || c->isfloat)) { |
399 | 143 |
restack(c); |
144 |
resizemouse(c); |
|
18
1efa34c6e1b6
added mouse-based resizals
Anselm R. Garbe <garbeam@wmii.de>
parents:
16
diff
changeset
|
145 |
} |
1efa34c6e1b6
added mouse-based resizals
Anselm R. Garbe <garbeam@wmii.de>
parents:
16
diff
changeset
|
146 |
} |
1efa34c6e1b6
added mouse-based resizals
Anselm R. Garbe <garbeam@wmii.de>
parents:
16
diff
changeset
|
147 |
} |
1efa34c6e1b6
added mouse-based resizals
Anselm R. Garbe <garbeam@wmii.de>
parents:
16
diff
changeset
|
148 |
|
1efa34c6e1b6
added mouse-based resizals
Anselm R. Garbe <garbeam@wmii.de>
parents:
16
diff
changeset
|
149 |
static void |
387
dca6aca09653
simplified configurerequest
Anselm R. Garbe <arg@10kloc.org>
parents:
386
diff
changeset
|
150 |
synconfig(Client *c, int x, int y, int w, int h, unsigned int border) |
dca6aca09653
simplified configurerequest
Anselm R. Garbe <arg@10kloc.org>
parents:
386
diff
changeset
|
151 |
{ |
dca6aca09653
simplified configurerequest
Anselm R. Garbe <arg@10kloc.org>
parents:
386
diff
changeset
|
152 |
XEvent synev; |
dca6aca09653
simplified configurerequest
Anselm R. Garbe <arg@10kloc.org>
parents:
386
diff
changeset
|
153 |
|
dca6aca09653
simplified configurerequest
Anselm R. Garbe <arg@10kloc.org>
parents:
386
diff
changeset
|
154 |
synev.type = ConfigureNotify; |
dca6aca09653
simplified configurerequest
Anselm R. Garbe <arg@10kloc.org>
parents:
386
diff
changeset
|
155 |
synev.xconfigure.display = dpy; |
dca6aca09653
simplified configurerequest
Anselm R. Garbe <arg@10kloc.org>
parents:
386
diff
changeset
|
156 |
synev.xconfigure.event = c->win; |
dca6aca09653
simplified configurerequest
Anselm R. Garbe <arg@10kloc.org>
parents:
386
diff
changeset
|
157 |
synev.xconfigure.window = c->win; |
dca6aca09653
simplified configurerequest
Anselm R. Garbe <arg@10kloc.org>
parents:
386
diff
changeset
|
158 |
synev.xconfigure.x = x; |
dca6aca09653
simplified configurerequest
Anselm R. Garbe <arg@10kloc.org>
parents:
386
diff
changeset
|
159 |
synev.xconfigure.y = y; |
dca6aca09653
simplified configurerequest
Anselm R. Garbe <arg@10kloc.org>
parents:
386
diff
changeset
|
160 |
synev.xconfigure.width = w; |
dca6aca09653
simplified configurerequest
Anselm R. Garbe <arg@10kloc.org>
parents:
386
diff
changeset
|
161 |
synev.xconfigure.height = h; |
dca6aca09653
simplified configurerequest
Anselm R. Garbe <arg@10kloc.org>
parents:
386
diff
changeset
|
162 |
synev.xconfigure.border_width = border; |
dca6aca09653
simplified configurerequest
Anselm R. Garbe <arg@10kloc.org>
parents:
386
diff
changeset
|
163 |
synev.xconfigure.above = None; |
dca6aca09653
simplified configurerequest
Anselm R. Garbe <arg@10kloc.org>
parents:
386
diff
changeset
|
164 |
XSendEvent(dpy, c->win, True, NoEventMask, &synev); |
dca6aca09653
simplified configurerequest
Anselm R. Garbe <arg@10kloc.org>
parents:
386
diff
changeset
|
165 |
} |
dca6aca09653
simplified configurerequest
Anselm R. Garbe <arg@10kloc.org>
parents:
386
diff
changeset
|
166 |
|
dca6aca09653
simplified configurerequest
Anselm R. Garbe <arg@10kloc.org>
parents:
386
diff
changeset
|
167 |
static void |
5 | 168 |
configurerequest(XEvent *e) |
169 |
{ |
|
286 | 170 |
unsigned long newmask; |
123 | 171 |
Client *c; |
5 | 172 |
XConfigureRequestEvent *ev = &e->xconfigurerequest; |
173 |
XWindowChanges wc; |
|
174 |
||
18
1efa34c6e1b6
added mouse-based resizals
Anselm R. Garbe <garbeam@wmii.de>
parents:
16
diff
changeset
|
175 |
if((c = getclient(ev->window))) { |
400
052657ff2e7b
applied Sanders max_and_focus.patch
Anselm R. Garbe <arg@10kloc.org>
parents:
399
diff
changeset
|
176 |
if((c == sel) && !c->isfloat && (arrange != dofloat) && maximized) { |
387
dca6aca09653
simplified configurerequest
Anselm R. Garbe <arg@10kloc.org>
parents:
386
diff
changeset
|
177 |
synconfig(c, sx, sy + bh, sw - 2, sh - 2 - bh, ev->border_width); |
dca6aca09653
simplified configurerequest
Anselm R. Garbe <arg@10kloc.org>
parents:
386
diff
changeset
|
178 |
XSync(dpy, False); |
386
58288246d16c
now dwm enforces max screen size also in tiled mode on non-floating clients which are maximized
Anselm R. Garbe <arg@10kloc.org>
parents:
385
diff
changeset
|
179 |
return; |
58288246d16c
now dwm enforces max screen size also in tiled mode on non-floating clients which are maximized
Anselm R. Garbe <arg@10kloc.org>
parents:
385
diff
changeset
|
180 |
} |
29 | 181 |
gravitate(c, True); |
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
|
182 |
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
|
183 |
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
|
184 |
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
|
185 |
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
|
186 |
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
|
187 |
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
|
188 |
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
|
189 |
c->h = ev->height; |
29 | 190 |
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
|
191 |
c->border = ev->border_width; |
29 | 192 |
gravitate(c, 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
|
193 |
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
|
194 |
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
|
195 |
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
|
196 |
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
|
197 |
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
|
198 |
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
|
199 |
XConfigureWindow(dpy, c->win, newmask, &wc); |
387
dca6aca09653
simplified configurerequest
Anselm R. Garbe <arg@10kloc.org>
parents:
386
diff
changeset
|
200 |
else |
dca6aca09653
simplified configurerequest
Anselm R. Garbe <arg@10kloc.org>
parents:
386
diff
changeset
|
201 |
synconfig(c, c->x, c->y, c->w, c->h, c->border); |
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
|
202 |
XSync(dpy, False); |
385 | 203 |
if(c->isfloat) |
204 |
resize(c, False, TopLeft); |
|
196 | 205 |
else |
206 |
arrange(NULL); |
|
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
|
207 |
} |
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 |
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
|
209 |
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
|
210 |
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
|
211 |
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
|
212 |
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
|
213 |
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
|
214 |
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
|
215 |
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
|
216 |
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
|
217 |
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
|
218 |
} |
5 | 219 |
} |
220 |
||
221 |
static void |
|
222 |
destroynotify(XEvent *e) |
|
223 |
{ |
|
224 |
Client *c; |
|
225 |
XDestroyWindowEvent *ev = &e->xdestroywindow; |
|
226 |
||
11 | 227 |
if((c = getclient(ev->window))) |
228 |
unmanage(c); |
|
5 | 229 |
} |
230 |
||
231 |
static void |
|
232 |
enternotify(XEvent *e) |
|
233 |
{ |
|
123 | 234 |
Client *c; |
5 | 235 |
XCrossingEvent *ev = &e->xcrossing; |
236 |
||
232
98e9901b1dbb
disallow zoom on maximized clients
Anselm R.Garbe <arg@10ksloc.org>
parents:
231
diff
changeset
|
237 |
if(ev->mode != NotifyNormal || ev->detail == NotifyInferior) |
5 | 238 |
return; |
239 |
||
161
f381e34158d9
implemented focus on enterwindow on titlebars
arg@10ksloc.org
parents:
160
diff
changeset
|
240 |
if((c = getclient(ev->window)) || (c = getctitle(ev->window))) |
13
5cc5e55a132d
added protocol killing stuff
Anselm R. Garbe <garbeam@wmii.de>
parents:
11
diff
changeset
|
241 |
focus(c); |
239
e5390f8e06b9
applied sumik's multihead patch
Anselm R.Garbe <arg@10ksloc.org>
parents:
238
diff
changeset
|
242 |
else if(ev->window == root) { |
31 | 243 |
issel = True; |
239
e5390f8e06b9
applied sumik's multihead patch
Anselm R.Garbe <arg@10ksloc.org>
parents:
238
diff
changeset
|
244 |
XSetInputFocus(dpy, root, RevertToPointerRoot, CurrentTime); |
e5390f8e06b9
applied sumik's multihead patch
Anselm R.Garbe <arg@10ksloc.org>
parents:
238
diff
changeset
|
245 |
drawall(); |
e5390f8e06b9
applied sumik's multihead patch
Anselm R.Garbe <arg@10ksloc.org>
parents:
238
diff
changeset
|
246 |
} |
5 | 247 |
} |
248 |
||
249 |
static void |
|
250 |
expose(XEvent *e) |
|
251 |
{ |
|
123 | 252 |
Client *c; |
5 | 253 |
XExposeEvent *ev = &e->xexpose; |
254 |
||
255 |
if(ev->count == 0) { |
|
70 | 256 |
if(barwin == ev->window) |
74 | 257 |
drawstatus(); |
75 | 258 |
else if((c = getctitle(ev->window))) |
74 | 259 |
drawtitle(c); |
5 | 260 |
} |
261 |
} |
|
262 |
||
263 |
static void |
|
76
4bd49f404f10
proceeded with cleaning up, sorting functions, etc
Anselm R. Garbe <garbeam@wmii.de>
parents:
75
diff
changeset
|
264 |
keypress(XEvent *e) |
4bd49f404f10
proceeded with cleaning up, sorting functions, etc
Anselm R. Garbe <garbeam@wmii.de>
parents:
75
diff
changeset
|
265 |
{ |
138
c1185dc7a36e
some cleanups/fixes inspired by Jukka Salmi's feedback
arg@10ksloc.org
parents:
137
diff
changeset
|
266 |
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
|
267 |
unsigned int i; |
4bd49f404f10
proceeded with cleaning up, sorting functions, etc
Anselm R. Garbe <garbeam@wmii.de>
parents:
75
diff
changeset
|
268 |
KeySym keysym; |
123 | 269 |
XKeyEvent *ev = &e->xkey; |
76
4bd49f404f10
proceeded with cleaning up, sorting functions, etc
Anselm R. Garbe <garbeam@wmii.de>
parents:
75
diff
changeset
|
270 |
|
4bd49f404f10
proceeded with cleaning up, sorting functions, etc
Anselm R. Garbe <garbeam@wmii.de>
parents:
75
diff
changeset
|
271 |
keysym = XKeycodeToKeysym(dpy, (KeyCode)ev->keycode, 0); |
275 | 272 |
for(i = 0; i < len; i++) { |
160 | 273 |
if(keysym == key[i].keysym && |
275 | 274 |
CLEANMASK(key[i].mod) == CLEANMASK(ev->state)) |
275 |
{ |
|
76
4bd49f404f10
proceeded with cleaning up, sorting functions, etc
Anselm R. Garbe <garbeam@wmii.de>
parents:
75
diff
changeset
|
276 |
if(key[i].func) |
4bd49f404f10
proceeded with cleaning up, sorting functions, etc
Anselm R. Garbe <garbeam@wmii.de>
parents:
75
diff
changeset
|
277 |
key[i].func(&key[i].arg); |
4bd49f404f10
proceeded with cleaning up, sorting functions, etc
Anselm R. Garbe <garbeam@wmii.de>
parents:
75
diff
changeset
|
278 |
return; |
4bd49f404f10
proceeded with cleaning up, sorting functions, etc
Anselm R. Garbe <garbeam@wmii.de>
parents:
75
diff
changeset
|
279 |
} |
275 | 280 |
} |
76
4bd49f404f10
proceeded with cleaning up, sorting functions, etc
Anselm R. Garbe <garbeam@wmii.de>
parents:
75
diff
changeset
|
281 |
} |
4bd49f404f10
proceeded with cleaning up, sorting functions, etc
Anselm R. Garbe <garbeam@wmii.de>
parents:
75
diff
changeset
|
282 |
|
4bd49f404f10
proceeded with cleaning up, sorting functions, etc
Anselm R. Garbe <garbeam@wmii.de>
parents:
75
diff
changeset
|
283 |
static void |
4bd49f404f10
proceeded with cleaning up, sorting functions, etc
Anselm R. Garbe <garbeam@wmii.de>
parents:
75
diff
changeset
|
284 |
leavenotify(XEvent *e) |
4bd49f404f10
proceeded with cleaning up, sorting functions, etc
Anselm R. Garbe <garbeam@wmii.de>
parents:
75
diff
changeset
|
285 |
{ |
4bd49f404f10
proceeded with cleaning up, sorting functions, etc
Anselm R. Garbe <garbeam@wmii.de>
parents:
75
diff
changeset
|
286 |
XCrossingEvent *ev = &e->xcrossing; |
4bd49f404f10
proceeded with cleaning up, sorting functions, etc
Anselm R. Garbe <garbeam@wmii.de>
parents:
75
diff
changeset
|
287 |
|
239
e5390f8e06b9
applied sumik's multihead patch
Anselm R.Garbe <arg@10ksloc.org>
parents:
238
diff
changeset
|
288 |
if((ev->window == root) && !ev->same_screen) { |
e5390f8e06b9
applied sumik's multihead patch
Anselm R.Garbe <arg@10ksloc.org>
parents:
238
diff
changeset
|
289 |
issel = False; |
e5390f8e06b9
applied sumik's multihead patch
Anselm R.Garbe <arg@10ksloc.org>
parents:
238
diff
changeset
|
290 |
drawall(); |
e5390f8e06b9
applied sumik's multihead patch
Anselm R.Garbe <arg@10ksloc.org>
parents:
238
diff
changeset
|
291 |
} |
76
4bd49f404f10
proceeded with cleaning up, sorting functions, etc
Anselm R. Garbe <garbeam@wmii.de>
parents:
75
diff
changeset
|
292 |
} |
4bd49f404f10
proceeded with cleaning up, sorting functions, etc
Anselm R. Garbe <garbeam@wmii.de>
parents:
75
diff
changeset
|
293 |
|
4bd49f404f10
proceeded with cleaning up, sorting functions, etc
Anselm R. Garbe <garbeam@wmii.de>
parents:
75
diff
changeset
|
294 |
static void |
279
2cedfbefd025
added mappingnotify event for kb refreshes
Anselm R.Garbe <arg@10ksloc.org>
parents:
278
diff
changeset
|
295 |
mappingnotify(XEvent *e) |
2cedfbefd025
added mappingnotify event for kb refreshes
Anselm R.Garbe <arg@10ksloc.org>
parents:
278
diff
changeset
|
296 |
{ |
2cedfbefd025
added mappingnotify event for kb refreshes
Anselm R.Garbe <arg@10ksloc.org>
parents:
278
diff
changeset
|
297 |
XMappingEvent *ev = &e->xmapping; |
2cedfbefd025
added mappingnotify event for kb refreshes
Anselm R.Garbe <arg@10ksloc.org>
parents:
278
diff
changeset
|
298 |
|
2cedfbefd025
added mappingnotify event for kb refreshes
Anselm R.Garbe <arg@10ksloc.org>
parents:
278
diff
changeset
|
299 |
XRefreshKeyboardMapping(ev); |
2cedfbefd025
added mappingnotify event for kb refreshes
Anselm R.Garbe <arg@10ksloc.org>
parents:
278
diff
changeset
|
300 |
if(ev->request == MappingKeyboard) |
2cedfbefd025
added mappingnotify event for kb refreshes
Anselm R.Garbe <arg@10ksloc.org>
parents:
278
diff
changeset
|
301 |
grabkeys(); |
2cedfbefd025
added mappingnotify event for kb refreshes
Anselm R.Garbe <arg@10ksloc.org>
parents:
278
diff
changeset
|
302 |
} |
2cedfbefd025
added mappingnotify event for kb refreshes
Anselm R.Garbe <arg@10ksloc.org>
parents:
278
diff
changeset
|
303 |
|
2cedfbefd025
added mappingnotify event for kb refreshes
Anselm R.Garbe <arg@10ksloc.org>
parents:
278
diff
changeset
|
304 |
static void |
5 | 305 |
maprequest(XEvent *e) |
306 |
{ |
|
123 | 307 |
static XWindowAttributes wa; |
5 | 308 |
XMapRequestEvent *ev = &e->xmaprequest; |
309 |
||
310 |
if(!XGetWindowAttributes(dpy, ev->window, &wa)) |
|
311 |
return; |
|
312 |
||
313 |
if(wa.override_redirect) { |
|
314 |
XSelectInput(dpy, ev->window, |
|
315 |
(StructureNotifyMask | PropertyChangeMask)); |
|
316 |
return; |
|
317 |
} |
|
318 |
||
10
703255003abb
changed how manage client works
Anselm R. Garbe <garbeam@wmii.de>
parents:
9
diff
changeset
|
319 |
if(!getclient(ev->window)) |
703255003abb
changed how manage client works
Anselm R. Garbe <garbeam@wmii.de>
parents:
9
diff
changeset
|
320 |
manage(ev->window, &wa); |
5 | 321 |
} |
322 |
||
323 |
static void |
|
324 |
propertynotify(XEvent *e) |
|
325 |
{ |
|
123 | 326 |
Client *c; |
53 | 327 |
Window trans; |
123 | 328 |
XPropertyEvent *ev = &e->xproperty; |
5 | 329 |
|
330 |
if(ev->state == PropertyDelete) |
|
331 |
return; /* ignore */ |
|
332 |
||
13
5cc5e55a132d
added protocol killing stuff
Anselm R. Garbe <garbeam@wmii.de>
parents:
11
diff
changeset
|
333 |
if((c = getclient(ev->window))) { |
77 | 334 |
if(ev->atom == wmatom[WMProtocols]) { |
75 | 335 |
c->proto = getproto(c->win); |
30
2e0fb4130bfb
new stuff, fixed several issues
Anselm R. Garbe <garbeam@wmii.de>
parents:
29
diff
changeset
|
336 |
return; |
2e0fb4130bfb
new stuff, fixed several issues
Anselm R. Garbe <garbeam@wmii.de>
parents:
29
diff
changeset
|
337 |
} |
13
5cc5e55a132d
added protocol killing stuff
Anselm R. Garbe <garbeam@wmii.de>
parents:
11
diff
changeset
|
338 |
switch (ev->atom) { |
5cc5e55a132d
added protocol killing stuff
Anselm R. Garbe <garbeam@wmii.de>
parents:
11
diff
changeset
|
339 |
default: break; |
5cc5e55a132d
added protocol killing stuff
Anselm R. Garbe <garbeam@wmii.de>
parents:
11
diff
changeset
|
340 |
case XA_WM_TRANSIENT_FOR: |
53 | 341 |
XGetTransientForHint(dpy, c->win, &trans); |
80
8125f908c80c
several additions in mouse handling ;)
Anselm R. Garbe <garbeam@wmii.de>
parents:
79
diff
changeset
|
342 |
if(!c->isfloat && (c->isfloat = (trans != 0))) |
53 | 343 |
arrange(NULL); |
13
5cc5e55a132d
added protocol killing stuff
Anselm R. Garbe <garbeam@wmii.de>
parents:
11
diff
changeset
|
344 |
break; |
5cc5e55a132d
added protocol killing stuff
Anselm R. Garbe <garbeam@wmii.de>
parents:
11
diff
changeset
|
345 |
case XA_WM_NORMAL_HINTS: |
74 | 346 |
setsize(c); |
13
5cc5e55a132d
added protocol killing stuff
Anselm R. Garbe <garbeam@wmii.de>
parents:
11
diff
changeset
|
347 |
break; |
5cc5e55a132d
added protocol killing stuff
Anselm R. Garbe <garbeam@wmii.de>
parents:
11
diff
changeset
|
348 |
} |
77 | 349 |
if(ev->atom == XA_WM_NAME || ev->atom == netatom[NetWMName]) { |
74 | 350 |
settitle(c); |
351 |
drawtitle(c); |
|
13
5cc5e55a132d
added protocol killing stuff
Anselm R. Garbe <garbeam@wmii.de>
parents:
11
diff
changeset
|
352 |
} |
5cc5e55a132d
added protocol killing stuff
Anselm R. Garbe <garbeam@wmii.de>
parents:
11
diff
changeset
|
353 |
} |
5 | 354 |
} |
355 |
||
356 |
static void |
|
357 |
unmapnotify(XEvent *e) |
|
358 |
{ |
|
359 |
Client *c; |
|
360 |
XUnmapEvent *ev = &e->xunmap; |
|
361 |
||
10
703255003abb
changed how manage client works
Anselm R. Garbe <garbeam@wmii.de>
parents:
9
diff
changeset
|
362 |
if((c = getclient(ev->window))) |
703255003abb
changed how manage client works
Anselm R. Garbe <garbeam@wmii.de>
parents:
9
diff
changeset
|
363 |
unmanage(c); |
5 | 364 |
} |
76
4bd49f404f10
proceeded with cleaning up, sorting functions, etc
Anselm R. Garbe <garbeam@wmii.de>
parents:
75
diff
changeset
|
365 |
|
84
052fe7498930
ordered variables in structs and source files alphabetically
Anselm R. Garbe <garbeam@wmii.de>
parents:
80
diff
changeset
|
366 |
/* extern */ |
76
4bd49f404f10
proceeded with cleaning up, sorting functions, etc
Anselm R. Garbe <garbeam@wmii.de>
parents:
75
diff
changeset
|
367 |
|
4bd49f404f10
proceeded with cleaning up, sorting functions, etc
Anselm R. Garbe <garbeam@wmii.de>
parents:
75
diff
changeset
|
368 |
void (*handler[LASTEvent]) (XEvent *) = { |
4bd49f404f10
proceeded with cleaning up, sorting functions, etc
Anselm R. Garbe <garbeam@wmii.de>
parents:
75
diff
changeset
|
369 |
[ButtonPress] = buttonpress, |
4bd49f404f10
proceeded with cleaning up, sorting functions, etc
Anselm R. Garbe <garbeam@wmii.de>
parents:
75
diff
changeset
|
370 |
[ConfigureRequest] = configurerequest, |
4bd49f404f10
proceeded with cleaning up, sorting functions, etc
Anselm R. Garbe <garbeam@wmii.de>
parents:
75
diff
changeset
|
371 |
[DestroyNotify] = destroynotify, |
4bd49f404f10
proceeded with cleaning up, sorting functions, etc
Anselm R. Garbe <garbeam@wmii.de>
parents:
75
diff
changeset
|
372 |
[EnterNotify] = enternotify, |
4bd49f404f10
proceeded with cleaning up, sorting functions, etc
Anselm R. Garbe <garbeam@wmii.de>
parents:
75
diff
changeset
|
373 |
[LeaveNotify] = leavenotify, |
4bd49f404f10
proceeded with cleaning up, sorting functions, etc
Anselm R. Garbe <garbeam@wmii.de>
parents:
75
diff
changeset
|
374 |
[Expose] = expose, |
4bd49f404f10
proceeded with cleaning up, sorting functions, etc
Anselm R. Garbe <garbeam@wmii.de>
parents:
75
diff
changeset
|
375 |
[KeyPress] = keypress, |
279
2cedfbefd025
added mappingnotify event for kb refreshes
Anselm R.Garbe <arg@10ksloc.org>
parents:
278
diff
changeset
|
376 |
[MappingNotify] = mappingnotify, |
76
4bd49f404f10
proceeded with cleaning up, sorting functions, etc
Anselm R. Garbe <garbeam@wmii.de>
parents:
75
diff
changeset
|
377 |
[MapRequest] = maprequest, |
4bd49f404f10
proceeded with cleaning up, sorting functions, etc
Anselm R. Garbe <garbeam@wmii.de>
parents:
75
diff
changeset
|
378 |
[PropertyNotify] = propertynotify, |
4bd49f404f10
proceeded with cleaning up, sorting functions, etc
Anselm R. Garbe <garbeam@wmii.de>
parents:
75
diff
changeset
|
379 |
[UnmapNotify] = unmapnotify |
4bd49f404f10
proceeded with cleaning up, sorting functions, etc
Anselm R. Garbe <garbeam@wmii.de>
parents:
75
diff
changeset
|
380 |
}; |
4bd49f404f10
proceeded with cleaning up, sorting functions, etc
Anselm R. Garbe <garbeam@wmii.de>
parents:
75
diff
changeset
|
381 |
|
4bd49f404f10
proceeded with cleaning up, sorting functions, etc
Anselm R. Garbe <garbeam@wmii.de>
parents:
75
diff
changeset
|
382 |
void |
4bd49f404f10
proceeded with cleaning up, sorting functions, etc
Anselm R. Garbe <garbeam@wmii.de>
parents:
75
diff
changeset
|
383 |
grabkeys() |
4bd49f404f10
proceeded with cleaning up, sorting functions, etc
Anselm R. Garbe <garbeam@wmii.de>
parents:
75
diff
changeset
|
384 |
{ |
138
c1185dc7a36e
some cleanups/fixes inspired by Jukka Salmi's feedback
arg@10ksloc.org
parents:
137
diff
changeset
|
385 |
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
|
386 |
unsigned int i; |
4bd49f404f10
proceeded with cleaning up, sorting functions, etc
Anselm R. Garbe <garbeam@wmii.de>
parents:
75
diff
changeset
|
387 |
KeyCode code; |
4bd49f404f10
proceeded with cleaning up, sorting functions, etc
Anselm R. Garbe <garbeam@wmii.de>
parents:
75
diff
changeset
|
388 |
|
279
2cedfbefd025
added mappingnotify event for kb refreshes
Anselm R.Garbe <arg@10ksloc.org>
parents:
278
diff
changeset
|
389 |
XUngrabKey(dpy, AnyKey, AnyModifier, root); |
76
4bd49f404f10
proceeded with cleaning up, sorting functions, etc
Anselm R. Garbe <garbeam@wmii.de>
parents:
75
diff
changeset
|
390 |
for(i = 0; i < len; i++) { |
4bd49f404f10
proceeded with cleaning up, sorting functions, etc
Anselm R. Garbe <garbeam@wmii.de>
parents:
75
diff
changeset
|
391 |
code = XKeysymToKeycode(dpy, key[i].keysym); |
4bd49f404f10
proceeded with cleaning up, sorting functions, etc
Anselm R. Garbe <garbeam@wmii.de>
parents:
75
diff
changeset
|
392 |
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
|
393 |
GrabModeAsync, GrabModeAsync); |
160 | 394 |
XGrabKey(dpy, code, key[i].mod | LockMask, root, True, |
395 |
GrabModeAsync, GrabModeAsync); |
|
291
8e6e0aa5e2ae
removed NUMLOCKMASK, added dynamically calculated numlockmask instead
Anselm R.Garbe <arg@10ksloc.org>
parents:
288
diff
changeset
|
396 |
XGrabKey(dpy, code, key[i].mod | numlockmask, root, True, |
146
f328ce9c558c
centralized/externalized configuration to config.h
arg@10ksloc.org
parents:
145
diff
changeset
|
397 |
GrabModeAsync, GrabModeAsync); |
291
8e6e0aa5e2ae
removed NUMLOCKMASK, added dynamically calculated numlockmask instead
Anselm R.Garbe <arg@10ksloc.org>
parents:
288
diff
changeset
|
398 |
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
|
399 |
GrabModeAsync, GrabModeAsync); |
76
4bd49f404f10
proceeded with cleaning up, sorting functions, etc
Anselm R. Garbe <garbeam@wmii.de>
parents:
75
diff
changeset
|
400 |
} |
4bd49f404f10
proceeded with cleaning up, sorting functions, etc
Anselm R. Garbe <garbeam@wmii.de>
parents:
75
diff
changeset
|
401 |
} |
292 | 402 |
|
403 |
void |
|
404 |
procevent() |
|
405 |
{ |
|
406 |
XEvent ev; |
|
407 |
||
408 |
while(XPending(dpy)) { |
|
409 |
XNextEvent(dpy, &ev); |
|
410 |
if(handler[ev.type]) |
|
411 |
(handler[ev.type])(&ev); /* call handler */ |
|
412 |
} |
|
413 |
} |
|
414 |