Krolyxon
Commit e2ef9b8

Branches

Refs →

nsxive2ef9b8

Variable timeout (2)

Author
Bert
Date
2011-02-17 17:32 +0100
Parents
6adbb38 fbfec45
Commit
e2ef9b8323a475f5e9f1a5692578e59df47eeb9b

+5 −5

1 file changed

  1. M main.c +5 −5
M main.c View
@@ -255,7 +255,7 @@ void read_dir_rec(const char *dirname) {
255255
256256 /* event handling */
257257
258−unsigned char timeout;
258+int timeout;
259259 int mox, moy;
260260
261261 void redraw() {
@@ -515,7 +515,7 @@ void on_motionnotify(XMotionEvent *mev) {
515515
516516 if (mev->x >= 0 && mev->x <= win.w && mev->y >= 0 && mev->y <= win.h) {
517517 if (img_move(&img, &win, mev->x - mox, mev->y - moy))
518− timeout = 1;
518+ timeout = 1000;
519519
520520 mox = mev->x;
521521 moy = mev->y;
@@ -547,11 +547,11 @@ void run() {
547547 redraw();
548548 continue;
549549 } else {
550− timeout = 1;
550+ timeout = 75000;
551551 }
552552 } else if (timeout) {
553553 t.tv_sec = 0;
554− t.tv_usec = 75000;
554+ t.tv_usec = timeout;
555555 xfd = ConnectionNumber(win.env.dpy);
556556 FD_ZERO(&fds);
557557 FD_SET(xfd, &fds);
@@ -577,7 +577,7 @@ void run() {
577577 break;
578578 case ConfigureNotify:
579579 if (win_configure(&win, &ev.xconfigure)) {
580− timeout = 1;
580+ timeout = 75000;
581581 if (mode == MODE_NORMAL)
582582 img.checkpan = 1;
583583 }