aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
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
commitaf66b61b81a0098e9d1379155539e5f7f0d3352f (patch)
tree78f89615f64fac7cfdd70116d632b51e55cd4e92
parent2fab4476c1f689380142061c94734e42972c1300 (diff)
downloadmirror-meh-af66b61b81a0098e9d1379155539e5f7f0d3352f.tar.gz
mirror-meh-af66b61b81a0098e9d1379155539e5f7f0d3352f.tar.bz2
mirror-meh-af66b61b81a0098e9d1379155539e5f7f0d3352f.zip
select() waits properly, cleanup in main.c
-rw-r--r--src/main.c23
1 files changed, 10 insertions, 13 deletions
diff --git a/src/main.c b/src/main.c
index 7734b66..2437ac0 100644
--- a/src/main.c
+++ b/src/main.c
@@ -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;
- }*/
}
}
}