about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAnselm R.Garbe <arg@10ksloc.org>2006-08-14 10:24:38 +0200
committerAnselm R.Garbe <arg@10ksloc.org>2006-08-14 10:24:38 +0200
commit375a251d16de567b6c62cce208f388cd16e0ce0f (patch)
tree15b16722d42a6f9ae483a89786431b0c0fb5cb5b
parentd4b7a9a3735deeab639f28b5bb2f568e0dc49616 (diff)
downloaddwm-375a251d16de567b6c62cce208f388cd16e0ce0f.tar.gz
implemented ungrabkeys() which is called in cleanup()
-rw-r--r--dwm.h1
-rw-r--r--event.c16
-rw-r--r--main.c1
3 files changed, 18 insertions, 0 deletions
diff --git a/dwm.h b/dwm.h
index c13179f..a1bd1e4 100644
--- a/dwm.h
+++ b/dwm.h
@@ -108,6 +108,7 @@ extern unsigned int textw(const char *text);
 
 /* event.c */
 extern void grabkeys();
+extern void ungrabkeys();
 
 /* main.c */
 extern int getproto(Window w);
diff --git a/event.c b/event.c
index e5ca166..4357eae 100644
--- a/event.c
+++ b/event.c
@@ -370,3 +370,19 @@ grabkeys()
 				GrabModeAsync, GrabModeAsync);
 	}
 }
+
+void
+ungrabkeys()
+{
+	static unsigned int len = sizeof(key) / sizeof(key[0]);
+	unsigned int i;
+	KeyCode code;
+
+	for(i = 0; i < len; i++) {
+		code = XKeysymToKeycode(dpy, key[i].keysym);
+		XUngrabKey(dpy, code, key[i].mod, root);
+		XUngrabKey(dpy, code, key[i].mod | LockMask, root);
+		XUngrabKey(dpy, code, key[i].mod | NUMLOCKMASK, root);
+		XUngrabKey(dpy, code, key[i].mod | NUMLOCKMASK | LockMask, root);
+	}
+}
diff --git a/main.c b/main.c
index 16ebbae..228228b 100644
--- a/main.c
+++ b/main.c
@@ -22,6 +22,7 @@ static Bool otherwm;
 static void
 cleanup()
 {
+	ungrabkeys();
 	while(sel) {
 		resize(sel, True, TopLeft);
 		unmanage(sel);
wm.h?h=5.6.1&id=5ed16faecb94b551ea00ea940e8d719211576de8'>^
439e15d ^
c225e1a ^
bf35794 ^
1076f2b
439e15d ^
bf35794 ^
1076f2b
b55bd70 ^


b5159df ^
7b5638f ^
c53980c ^
b5159df ^
8b59083 ^


bf35794 ^

b5159df ^
8b59083 ^
b5159df ^
8b59083 ^
b55bd70 ^


bf35794 ^


b5159df ^
8b59083 ^
b5159df ^
1076f2b
da2bbd3 ^
3399650 ^
1173723 ^

a05beb6 ^
2e836ec ^
a05beb6 ^
9d73909 ^
901b3ed ^
b355755 ^
1076f2b
72707c2 ^
bf35794 ^
7e597ae ^
1076f2b

b355755 ^
8cc7f3b ^
e995c1b ^

66da153 ^

bf35794 ^
26157e6 ^
efa7e51 ^
bf35794 ^


bf35794 ^
39677ec ^
439e15d ^
dba2306 ^
3399650 ^
adaa28a ^
dba2306 ^
adaa28a ^
adaa28a ^
adaa28a ^
04eb016 ^
adaa28a ^

4688ad1 ^
adaa28a ^
3399650 ^
d7e1708 ^
dba2306 ^
c0705ee ^
adaa28a ^
c0705ee ^

8cc7f3b ^
d7e1708 ^
dba2306 ^
29355bd ^
b6ad663 ^
b9da4b0 ^
9e8b325 ^
adaa28a ^
c47da14 ^
dba2306 ^
adaa28a ^
9e8b325 ^
dba2306 ^
e21d93b ^
937cabf ^
72707c2 ^
adaa28a ^
19da197 ^
19da197 ^
29355bd ^
8b59083 ^
8b59083 ^
adaa28a ^
d4b7a9a ^
c47da14 ^
aa13727 ^

8a6679b ^
aa13727 ^



6499fc4 ^
aa13727 ^




daae3bb ^
aa13727 ^
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141