flushdisplay (erik quanstrom)

This commit is contained in:
rsc 2006-03-27 00:50:52 +00:00
parent 94bd4b6c2c
commit 190f5e7cb2

View file

@ -20,12 +20,14 @@ eresized(int new)
draw(screen, screen->r, display->white, nil, ZP); draw(screen, screen->r, display->white, nil, ZP);
drawop(screen, screen->r, image, nil, image->r.min, S); drawop(screen, screen->r, image, nil, image->r.min, S);
flushimage(display, 1);
} }
void void
main(int argc, char **argv) main(int argc, char **argv)
{ {
int fd; int fd;
char *label;
Event e; Event e;
ARGBEGIN{ ARGBEGIN{
@ -42,16 +44,20 @@ main(int argc, char **argv)
if(argc == 1){ if(argc == 1){
if((fd = open(argv[0], OREAD)) < 0) if((fd = open(argv[0], OREAD)) < 0)
sysfatal("open %s: %r"); sysfatal("open %s: %r");
}else label = argv[0];
}else{
fd = 0; fd = 0;
label = nil;
}
if(initdraw(0, nil, nil) < 0) if(initdraw(0, nil, label) < 0)
sysfatal("initdraw: %r"); sysfatal("initdraw: %r");
if((image=readimage(display, fd, 0)) == nil) if((image=readimage(display, fd, 0)) == nil)
sysfatal("readimage: %r"); sysfatal("readimage: %r");
drawresizewindow(Rect(0,0,Dx(image->r),Dy(image->r))); if(winsize == nil)
drawresizewindow(Rect(0,0,Dx(image->r),Dy(image->r)));
einit(Emouse|Ekeyboard); einit(Emouse|Ekeyboard);
eresized(0); eresized(0);
@ -60,7 +66,6 @@ main(int argc, char **argv)
case Ekeyboard: case Ekeyboard:
if(e.kbdc == 'q' || e.kbdc == 0x7F) if(e.kbdc == 'q' || e.kbdc == 0x7F)
exits(nil); exits(nil);
eresized(0);
break; break;
case Emouse: case Emouse:
break; break;