Krolyxon
Commit fbfec45

Branches

Refs →

nsxivfbfec45

Variable timeout

Author
Bert
Date
2011-02-17 17:30 +0100
Parent
1ac3302
Commit
fbfec45b3360d4d0d4011bad182fc2a21f8da6ae

+4 −4

1 file changed

  1. M main.c +4 −4
M main.c View
@@ -230,7 +230,7 @@ void read_dir_rec(const char *dirname) {
230230
231231 /* event handling */
232232
233−unsigned char timeout;
233+int timeout;
234234 int mox, moy;
235235
236236 void on_keypress(XKeyEvent *kev) {
@@ -436,7 +436,7 @@ void on_motionnotify(XMotionEvent *mev) {
436436
437437 if (mev->x >= 0 && mev->x <= win.w && mev->y >= 0 && mev->y <= win.h) {
438438 if (img_move(&img, &win, mev->x - mox, mev->y - moy))
439− timeout = 1;
439+ timeout = 1000;
440440
441441 mox = mev->x;
442442 moy = mev->y;
@@ -454,7 +454,7 @@ void run() {
454454 while (1) {
455455 if (timeout) {
456456 t.tv_sec = 0;
457− t.tv_usec = 75000;
457+ t.tv_usec = timeout;
458458 xfd = ConnectionNumber(win.env.dpy);
459459 FD_ZERO(&fds);
460460 FD_SET(xfd, &fds);
@@ -483,7 +483,7 @@ void run() {
483483 case ConfigureNotify:
484484 if (win_configure(&win, &ev.xconfigure)) {
485485 img.checkpan = 1;
486− timeout = 1;
486+ timeout = 75000;
487487 }
488488 break;
489489 case ClientMessage: