diff options
Diffstat (limited to 'main.c')
| -rw-r--r-- | main.c | 16 |
1 files changed, 8 insertions, 8 deletions
| @@ -196,6 +196,7 @@ main(int argc, char *argv[]) | |||
| 196 | 196 | ||
| 197 | XSetErrorHandler(NULL); | 197 | XSetErrorHandler(NULL); |
| 198 | xerrorxlib = XSetErrorHandler(xerror); | 198 | xerrorxlib = XSetErrorHandler(xerror); |
| 199 | XSync(dpy, False); | ||
| 199 | 200 | ||
| 200 | /* init atoms */ | 201 | /* init atoms */ |
| 201 | wmatom[WMProtocols] = XInternAtom(dpy, "WM_PROTOCOLS", False); | 202 | wmatom[WMProtocols] = XInternAtom(dpy, "WM_PROTOCOLS", False); |
| @@ -269,13 +270,6 @@ main(int argc, char *argv[]) | |||
| 269 | if(i < 0) | 270 | if(i < 0) |
| 270 | eprint("select failed\n"); | 271 | eprint("select failed\n"); |
| 271 | else if(i > 0) { | 272 | else if(i > 0) { |
| 272 | if(FD_ISSET(xfd, &rd)) { | ||
| 273 | while(XPending(dpy)) { | ||
| 274 | XNextEvent(dpy, &ev); | ||
| 275 | if(handler[ev.type]) | ||
| 276 | (handler[ev.type])(&ev); /* call handler */ | ||
| 277 | } | ||
| 278 | } | ||
| 279 | if(readin && FD_ISSET(STDIN_FILENO, &rd)) { | 273 | if(readin && FD_ISSET(STDIN_FILENO, &rd)) { |
| 280 | readin = NULL != fgets(stext, sizeof(stext), stdin); | 274 | readin = NULL != fgets(stext, sizeof(stext), stdin); |
| 281 | if(readin) | 275 | if(readin) |
| @@ -284,9 +278,15 @@ main(int argc, char *argv[]) | |||
| 284 | strcpy(stext, "broken pipe"); | 278 | strcpy(stext, "broken pipe"); |
| 285 | drawstatus(); | 279 | drawstatus(); |
| 286 | } | 280 | } |
| 281 | if(FD_ISSET(xfd, &rd)) { | ||
| 282 | while(XPending(dpy)) { | ||
| 283 | XNextEvent(dpy, &ev); | ||
| 284 | if(handler[ev.type]) | ||
| 285 | (handler[ev.type])(&ev); /* call handler */ | ||
| 286 | } | ||
| 287 | } | ||
| 287 | } | 288 | } |
| 288 | } | 289 | } |
| 289 | |||
| 290 | cleanup(); | 290 | cleanup(); |
| 291 | XCloseDisplay(dpy); | 291 | XCloseDisplay(dpy); |
| 292 | 292 | ||
