--- ray/src/px/x11image.c 1991/05/03 10:54:47 1.20 +++ ray/src/px/x11image.c 1991/05/03 12:01:44 1.21 @@ -81,6 +81,8 @@ double exposure = 1.0; /* exposure compensation use int wrongformat = 0; /* input in another format? */ +int imready = 0; /* is image up? */ + GC revgc; /* graphics context with GXinvert */ XRASTER *ourras; /* our stored image */ @@ -280,7 +282,11 @@ init() /* get data and open window */ |ButtonMotionMask|StructureNotifyMask |KeyPressMask|ExposureMask); XMapWindow(thedisplay, wind); - /* store name last as ready signal */ + /* make sure the image is up */ + do + getevent(); + while (!imready); + /* store name as ready signal */ XStoreName(thedisplay, wind, fname == NULL ? progname : fname); return; memerr: @@ -388,6 +394,7 @@ getevent() /* process the next event */ break; case Expose: redraw(e.e.x, e.e.y, e.e.width, e.e.height); + imready++; break; case ButtonPress: if (e.b.state & (ShiftMask|ControlMask))