diff options
author | "John Hawthorn ext:(%22) <jhawthor@uvic.ca> | 2008-12-31 17:10:04 -0800 |
---|---|---|
committer | "John Hawthorn ext:(%22) <jhawthor@uvic.ca> | 2008-12-31 17:10:04 -0800 |
commit | af66b61b81a0098e9d1379155539e5f7f0d3352f (patch) | |
tree | 78f89615f64fac7cfdd70116d632b51e55cd4e92 /src | |
parent | 2fab4476c1f689380142061c94734e42972c1300 (diff) | |
download | mirror-meh-af66b61b81a0098e9d1379155539e5f7f0d3352f.tar.gz mirror-meh-af66b61b81a0098e9d1379155539e5f7f0d3352f.tar.bz2 mirror-meh-af66b61b81a0098e9d1379155539e5f7f0d3352f.zip |
select() waits properly, cleanup in main.c
Diffstat (limited to 'src')
-rw-r--r-- | src/main.c | 23 |
1 files changed, 10 insertions, 13 deletions
@@ -183,7 +183,7 @@ int doredraw(struct image **i){ return 0; if(!(*i = imageopen2(images[0]))){ images[0] = NULL; - return; + return 0; } }else{ int firstimg = imageidx; @@ -255,23 +255,20 @@ void run(){ images[0][read-1] = '\0'; } if(XPending(display)){ + tv = &tv0; + XEvent event; do{ - tv = &tv0; - XEvent event; XNextEvent(display, &event); handleevent(&event); }while(XPending(display)); - }else if(ret == 0 && (mode != MODE_CTL || images[0] != NULL)){ - if(!img || img->state != BILINEARDRAWN){ - doredraw(&img); + }else if(ret == 0){ + if(mode == MODE_CTL && images[0] == NULL){ + tv = NULL; + }else if(!img || img->state != BILINEARDRAWN){ + if(!doredraw(&img)){ + tv = NULL; + } } - /*else if(!nextimg || !nextimg->ximg || !nextimg->redraw){ - doredraw(&nextimg); - }else if(!previmg || !previmg->ximg || !previmg->redraw){ - doredraw(&previmg); - }else{ - tv = &tv0; - }*/ } } } |