summaryrefslogtreecommitdiffstats
path: root/main.c
diff options
context:
space:
mode:
authorBert <ber.t@gmx.com>2011-02-17 17:32:29 +0100
committerBert <ber.t@gmx.com>2011-02-17 17:32:29 +0100
commite2ef9b8323a475f5e9f1a5692578e59df47eeb9b (patch)
tree0cc9260114d97cb51b227b32b5d1935ddd3044a1 /main.c
parent6adbb3831d889b7a0fa3b69e40843d8b70beaf55 (diff)
parentfbfec45b3360d4d0d4011bad182fc2a21f8da6ae (diff)
downloadnsxiv-e2ef9b8323a475f5e9f1a5692578e59df47eeb9b.tar.zst
Variable timeout (2)
Diffstat (limited to 'main.c')
-rw-r--r--main.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/main.c b/main.c
index 4189f4f..35326fd 100644
--- a/main.c
+++ b/main.c
@@ -255,7 +255,7 @@ void read_dir_rec(const char *dirname) {
/* event handling */
-unsigned char timeout;
+int timeout;
int mox, moy;
void redraw() {
@@ -515,7 +515,7 @@ void on_motionnotify(XMotionEvent *mev) {
if (mev->x >= 0 && mev->x <= win.w && mev->y >= 0 && mev->y <= win.h) {
if (img_move(&img, &win, mev->x - mox, mev->y - moy))
- timeout = 1;
+ timeout = 1000;
mox = mev->x;
moy = mev->y;
@@ -547,11 +547,11 @@ void run() {
redraw();
continue;
} else {
- timeout = 1;
+ timeout = 75000;
}
} else if (timeout) {
t.tv_sec = 0;
- t.tv_usec = 75000;
+ t.tv_usec = timeout;
xfd = ConnectionNumber(win.env.dpy);
FD_ZERO(&fds);
FD_SET(xfd, &fds);
@@ -577,7 +577,7 @@ void run() {
break;
case ConfigureNotify:
if (win_configure(&win, &ev.xconfigure)) {
- timeout = 1;
+ timeout = 75000;
if (mode == MODE_NORMAL)
img.checkpan = 1;
}