* Separate display connection for each thread. */
| 423 | * Separate display connection for each thread. |
| 424 | */ |
| 425 | static void |
| 426 | event_loop_multi(void) |
| 427 | { |
| 428 | XEvent event; |
| 429 | int w = 0; |
| 430 | |
| 431 | assert(MultiDisplays); |
| 432 | |
| 433 | while (!ExitFlag) { |
| 434 | struct winthread *wt = &WinThreads[w]; |
| 435 | if (XPending(wt->Dpy)) { |
| 436 | XNextEvent(wt->Dpy, &event); |
| 437 | switch (event.type) { |
| 438 | case ConfigureNotify: |
| 439 | resize(wt, event.xconfigure.width, event.xconfigure.height); |
| 440 | break; |
| 441 | case KeyPress: |
| 442 | keypress(&event, wt); |
| 443 | break; |
| 444 | default: |
| 445 | ; /* nop */ |
| 446 | } |
| 447 | } |
| 448 | w = (w + 1) % NumWinThreads; |
| 449 | usleep(5000); |
| 450 | } |
| 451 | } |
| 452 | |
| 453 | |
| 454 |
no test coverage detected