summaryrefslogtreecommitdiff
path: root/src/mtview.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mtview.c')
-rw-r--r--src/mtview.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/mtview.c b/src/mtview.c
index afa6e2a..8891987 100644
--- a/src/mtview.c
+++ b/src/mtview.c
@@ -5,8 +5,8 @@
5#include <string.h> 5#include <string.h>
6#include <math.h> 6#include <math.h>
7 7
8#define XMARG 64 8#define XMARG 16
9#define YMARG 64 9#define YMARG 16
10#define WSCALE 0.5 10#define WSCALE 0.5
11#define FLUSH_MS 10 11#define FLUSH_MS 10
12#define DEF_FRAC 0.15 12#define DEF_FRAC 0.15
@@ -29,7 +29,7 @@ static inline float max(float a, float b)
29 29
30static unsigned long new_color(struct windata *w) 30static unsigned long new_color(struct windata *w)
31{ 31{
32 return lrand48(); 32 return lrand48() & 0xffffff;
33} 33}
34 34
35static void clear_screen(struct windata *w) 35static void clear_screen(struct windata *w)
@@ -115,12 +115,10 @@ static void event_loop(struct touch_dev *dev, int fd, struct windata *w)
115 115
116 clear_screen(w); 116 clear_screen(w);
117 while (1) { 117 while (1) {
118 XFlush(w->dsp); 118 if(!touch_dev_idle(dev, fd, 100))
119 while(!touch_dev_idle(dev, fd, 100))
120 touch_dev_pull(dev, fd); 119 touch_dev_pull(dev, fd);
121 if (XEventsQueued(w->dsp, QueuedAlready)) { 120 while (XPending(w->dsp)) {
122 XNextEvent(w->dsp, &ev); 121 XNextEvent(w->dsp, &ev);
123 break;
124 } 122 }
125 } 123 }
126} 124}