Contents of /trunk/slim/patches/slim-1.3.2-fix-SIGTERM-freeze.patch
Parent Directory | Revision Log
Revision 1262 -
(show annotations)
(download)
Thu Jan 27 23:28:25 2011 UTC (13 years, 8 months ago) by niro
File size: 1284 byte(s)
Thu Jan 27 23:28:25 2011 UTC (13 years, 8 months ago) by niro
File size: 1284 byte(s)
added slim patches from upstream
1 | https://bugs.gentoo.org/show_bug.cgi?id=261359 |
2 | http://developer.berlios.de/bugs/?func=detailbug&bug_id=15326&group_id=2663 |
3 | |
4 | diff --git a/panel.cpp b/panel.cpp |
5 | index 032574d..075c008 100644 |
6 | --- a/panel.cpp |
7 | +++ b/panel.cpp |
8 | @@ -10,6 +10,7 @@ |
9 | */ |
10 | |
11 | #include <sstream> |
12 | +#include <poll.h> |
13 | #include "panel.h" |
14 | |
15 | using namespace std; |
16 | @@ -288,16 +289,24 @@ void Panel::EventHandler(const Panel::FieldType& curfield) { |
17 | field=curfield; |
18 | bool loop = true; |
19 | OnExpose(); |
20 | + |
21 | + struct pollfd x11_pfd = {0}; |
22 | + x11_pfd.fd = ConnectionNumber(Dpy); |
23 | + x11_pfd.events = POLLIN; |
24 | while(loop) { |
25 | - XNextEvent(Dpy, &event); |
26 | - switch(event.type) { |
27 | - case Expose: |
28 | - OnExpose(); |
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; |
37 | |
38 | - case KeyPress: |
39 | - loop=OnKeyPress(event); |
40 | - break; |
41 | + case KeyPress: |
42 | + loop=OnKeyPress(event); |
43 | + break; |
44 | + } |
45 | + } |
46 | } |
47 | } |
48 |