nsxivfbfec45
Variable timeout
+4 −4
1 file changed
- M main.c +4 −4
| @@ -230,7 +230,7 @@ void read_dir_rec(const char *dirname) { | |||
| 230 | 230 | ||
| 231 | 231 | /* event handling */ | |
| 232 | 232 | ||
| 233 | − | unsigned char timeout; | |
| 233 | + | int timeout; | |
| 234 | 234 | int mox, moy; | |
| 235 | 235 | ||
| 236 | 236 | void on_keypress(XKeyEvent *kev) { | |
| @@ -436,7 +436,7 @@ void on_motionnotify(XMotionEvent *mev) { | |||
| 436 | 436 | ||
| 437 | 437 | if (mev->x >= 0 && mev->x <= win.w && mev->y >= 0 && mev->y <= win.h) { | |
| 438 | 438 | if (img_move(&img, &win, mev->x - mox, mev->y - moy)) | |
| 439 | − | timeout = 1; | |
| 439 | + | timeout = 1000; | |
| 440 | 440 | ||
| 441 | 441 | mox = mev->x; | |
| 442 | 442 | moy = mev->y; | |
| @@ -454,7 +454,7 @@ void run() { | |||
| 454 | 454 | while (1) { | |
| 455 | 455 | if (timeout) { | |
| 456 | 456 | t.tv_sec = 0; | |
| 457 | − | t.tv_usec = 75000; | |
| 457 | + | t.tv_usec = timeout; | |
| 458 | 458 | xfd = ConnectionNumber(win.env.dpy); | |
| 459 | 459 | FD_ZERO(&fds); | |
| 460 | 460 | FD_SET(xfd, &fds); | |
| @@ -483,7 +483,7 @@ void run() { | |||
| 483 | 483 | case ConfigureNotify: | |
| 484 | 484 | if (win_configure(&win, &ev.xconfigure)) { | |
| 485 | 485 | img.checkpan = 1; | |
| 486 | − | timeout = 1; | |
| 486 | + | timeout = 75000; | |
| 487 | 487 | } | |
| 488 | 488 | break; | |
| 489 | 489 | case ClientMessage: | |