about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--main.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/main.c b/main.c
index d9ca9f7..42c9d8a 100644
--- a/main.c
+++ b/main.c
@@ -283,7 +283,7 @@ main(int argc, char *argv[])
 Mainloop:
 	while(running) {
 		FD_ZERO(&rd);
-		FD_SET(0, &rd);
+		FD_SET(STDIN_FILENO, &rd);
 		FD_SET(ConnectionNumber(dpy), &rd);
 
 		i = select(ConnectionNumber(dpy) + 1, &rd, 0, 0, 0);
@@ -292,12 +292,14 @@ Mainloop:
 		if(i < 0)
 			error("select failed\n");
 		else if(i > 0) {
-			if(FD_ISSET(ConnectionNumber(dpy), &rd) && XPending(dpy) > 0) {
-				XNextEvent(dpy, &ev);
-				if(handler[ev.type])
-					(handler[ev.type])(&ev); /* call handler */
+			if(FD_ISSET(ConnectionNumber(dpy), &rd)) {
+				while(XPending(dpy)) {
+					XNextEvent(dpy, &ev);
+					if(handler[ev.type])
+						(handler[ev.type])(&ev); /* call handler */
+				}
 			}
-			if(FD_ISSET(0, &rd)) {
+			if(FD_ISSET(STDIN_FILENO, &rd)) {
 				i = n = 0;
 				for(;;) {
 					if((i = getchar()) == EOF) {
tik K. Agaram <vc@akkartik.com> 2016-09-17 14:53:00 -0700 3394' href='/akkartik/mu/commit/045closure_name.cc?h=hlt&id=897ae8c1855f830d8819759ea327d147f28a09bf'>897ae8c1 ^
23d3a022 ^


82ac0b7e ^
1ead3562 ^
897ae8c1 ^
192d59d3 ^
23d3a022 ^
897ae8c1 ^
82ac0b7e ^
1ead3562 ^
897ae8c1 ^

192d59d3 ^


82ac0b7e ^
d9025124 ^
23d3a022 ^
82ac0b7e ^

436b2b2e ^
2199940a ^
82ac0b7e ^
2caaa7f1 ^


82ac0b7e ^
2caaa7f1 ^
b2e4056d ^
82ac0b7e ^

363be37f ^
795f5244 ^
6c96a437 ^
795f5244 ^
82ac0b7e ^
6c96a437 ^
ab6ed192 ^
0487a30e ^
aae198a9 ^
0f2781f8 ^
82ac0b7e ^

ae256ea1 ^

9dcbec39 ^
35064671 ^

af023b32 ^
ae256ea1 ^
3e5f4358 ^
9dcbec39 ^
3e5f4358 ^

f3760b0f ^
f22250a1 ^
9dcbec39 ^
82ac0b7e ^

795f5244 ^
57d01f21 ^
9dcbec39 ^
57d01f21 ^

f22250a1 ^
82ac0b7e ^



82ac0b7e ^


b24eb476 ^

82ac0b7e ^
1b76245c ^
82ac0b7e ^

ae256ea1 ^
af023b32 ^
b24eb476 ^
82ac0b7e ^
363be37f ^
1e38eee5 ^
363be37f ^

82ac0b7e ^




b24eb476 ^
82ac0b7e ^
f3760b0f ^
9dcbec39 ^
6c96a437 ^
1b76245c ^
82ac0b7e ^
1b76245c ^
1e38eee5 ^
82ac0b7e ^







b24eb476 ^
82ac0b7e ^
f3760b0f ^
9dcbec39 ^
1e38eee5 ^
82ac0b7e ^
f22250a1 ^

82ac0b7e ^

5f98a10c ^
b24eb476 ^

82ac0b7e ^
ae256ea1 ^
af023b32 ^
9dcbec39 ^
e4630643 ^

ae256ea1 ^
82ac0b7e ^
f3760b0f ^
82ac0b7e ^
1e38eee5 ^


1ead3562 ^
1e38eee5 ^
192d59d3 ^
1e38eee5 ^
9dcbec39 ^

2655ae72 ^



514f0e34 ^
760f683f ^

897ae8c1 ^
2655ae72 ^


aae198a9 ^
897ae8c1 ^
760f683f ^
2655ae72 ^

897ae8c1 ^
23d3a022 ^
2655ae72 ^
23d3a022 ^
b0631dec ^




a519b78c ^
b0631dec ^






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
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185