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
17 + struct pollfd x11_pfd = {0};
18 + x11_pfd.fd = ConnectionNumber(Dpy);
19 + x11_pfd.events = POLLIN;
21 - XNextEvent(Dpy, &event);
22 - switch(event.type) {
28 - loop=OnKeyPress(event);
30 + if(XPending(Dpy) || poll(&x11_pfd, 1, -1) > 0) {
31 + while(XPending(Dpy)) {
32 + XNextEvent(Dpy, &event);
33 + switch(event.type) {
39 + loop=OnKeyPress(event);