summaryrefslogtreecommitdiff
path: root/staging/slim/sigterm.patch
diff options
context:
space:
mode:
Diffstat (limited to 'staging/slim/sigterm.patch')
-rw-r--r--staging/slim/sigterm.patch45
1 files changed, 45 insertions, 0 deletions
diff --git a/staging/slim/sigterm.patch b/staging/slim/sigterm.patch
new file mode 100644
index 000000000..fbaeb7116
--- /dev/null
+++ b/staging/slim/sigterm.patch
@@ -0,0 +1,45 @@
+diff -aur old/panel.cpp new/panel.cpp
+--- old/panel.cpp 2011-04-29 15:15:57.210134850 +0200
++++ new/panel.cpp 2011-04-29 15:16:17.260285407 +0200
+@@ -10,6 +10,7 @@
+ */
+
+ #include <sstream>
++#include <poll.h>
+ #include "panel.h"
+
+ using namespace std;
+@@ -288,16 +289,24 @@
+ field=curfield;
+ bool loop = true;
+ OnExpose();
++
++ struct pollfd x11_pfd = {0};
++ x11_pfd.fd = ConnectionNumber(Dpy);
++ x11_pfd.events = POLLIN;
+ while(loop) {
+- XNextEvent(Dpy, &event);
+- switch(event.type) {
+- case Expose:
+- OnExpose();
+- break;
+-
+- case KeyPress:
+- loop=OnKeyPress(event);
+- break;
++ if(XPending(Dpy) || poll(&x11_pfd, 1, -1) > 0) {
++ while(XPending(Dpy)) {
++ XNextEvent(Dpy, &event);
++ switch(event.type) {
++ case Expose:
++ OnExpose();
++ break;
++
++ case KeyPress:
++ loop=OnKeyPress(event);
++ break;
++ }
++ }
+ }
+ }
+