summaryrefslogtreecommitdiff
path: root/extra/slim/sigterm.patch
diff options
context:
space:
mode:
authorroot <root@rshg047.dnsready.net>2011-04-30 22:33:37 +0000
committerroot <root@rshg047.dnsready.net>2011-04-30 22:33:37 +0000
commitc173ac862828a54925737fc1d90ede1dd09a312c (patch)
tree63d6b46455a4abdaf96aef59bbaa4406c6fe04f8 /extra/slim/sigterm.patch
parent693b5793b8c615601135bc04216a2ca0966087c5 (diff)
Sat Apr 30 22:33:37 UTC 2011
Diffstat (limited to 'extra/slim/sigterm.patch')
-rw-r--r--extra/slim/sigterm.patch45
1 files changed, 45 insertions, 0 deletions
diff --git a/extra/slim/sigterm.patch b/extra/slim/sigterm.patch
new file mode 100644
index 000000000..fbaeb7116
--- /dev/null
+++ b/extra/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;
++ }
++ }
+ }
+ }
+