updated on Sat Jan 21 16:18:39 UTC 2012
[aur-mirror.git] / slim-unicode / sigterm.patch
blobfbaeb7116c10b48ccf972419ebee4fb8bbbe9c3c
1 diff -aur old/panel.cpp new/panel.cpp
2 --- old/panel.cpp 2011-04-29 15:15:57.210134850 +0200
3 +++ new/panel.cpp 2011-04-29 15:16:17.260285407 +0200
4 @@ -10,6 +10,7 @@
5 */
7 #include <sstream>
8 +#include <poll.h>
9 #include "panel.h"
11 using namespace std;
12 @@ -288,16 +289,24 @@
13 field=curfield;
14 bool loop = true;
15 OnExpose();
17 + struct pollfd x11_pfd = {0};
18 + x11_pfd.fd = ConnectionNumber(Dpy);
19 + x11_pfd.events = POLLIN;
20 while(loop) {
21 - XNextEvent(Dpy, &event);
22 - switch(event.type) {
23 - case Expose:
24 - OnExpose();
25 - break;
27 - case KeyPress:
28 - loop=OnKeyPress(event);
29 - break;
30 + if(XPending(Dpy) || poll(&x11_pfd, 1, -1) > 0) {
31 + while(XPending(Dpy)) {
32 + XNextEvent(Dpy, &event);
33 + switch(event.type) {
34 + case Expose:
35 + OnExpose();
36 + break;
38 + case KeyPress:
39 + loop=OnKeyPress(event);
40 + break;
41 + }
42 + }