Variable timeout (2)
This commit is contained in:
commit
e2ef9b8323
10
main.c
10
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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue