diff options
author | rsc <devnull@localhost> | 2006-03-27 00:50:52 +0000 |
---|---|---|
committer | rsc <devnull@localhost> | 2006-03-27 00:50:52 +0000 |
commit | 190f5e7cb2cf36fb3898f4724092cc0a1a799624 (patch) | |
tree | 5352b1b5e0e762f509293eb94bd368425d1b4c87 /src/cmd/draw | |
parent | 94bd4b6c2cf40d30986ce45afc76cfda2ec09ed9 (diff) | |
download | plan9port-190f5e7cb2cf36fb3898f4724092cc0a1a799624.tar.gz plan9port-190f5e7cb2cf36fb3898f4724092cc0a1a799624.tar.bz2 plan9port-190f5e7cb2cf36fb3898f4724092cc0a1a799624.zip |
flushdisplay (erik quanstrom)
Diffstat (limited to 'src/cmd/draw')
-rw-r--r-- | src/cmd/draw/img.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/cmd/draw/img.c b/src/cmd/draw/img.c index d519263d..951a95d6 100644 --- a/src/cmd/draw/img.c +++ b/src/cmd/draw/img.c @@ -20,12 +20,14 @@ eresized(int new) draw(screen, screen->r, display->white, nil, ZP); drawop(screen, screen->r, image, nil, image->r.min, S); + flushimage(display, 1); } void main(int argc, char **argv) { int fd; + char *label; Event e; ARGBEGIN{ @@ -42,16 +44,20 @@ main(int argc, char **argv) if(argc == 1){ if((fd = open(argv[0], OREAD)) < 0) sysfatal("open %s: %r"); - }else + label = argv[0]; + }else{ fd = 0; + label = nil; + } - if(initdraw(0, nil, nil) < 0) + if(initdraw(0, nil, label) < 0) sysfatal("initdraw: %r"); if((image=readimage(display, fd, 0)) == nil) 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); eresized(0); @@ -60,7 +66,6 @@ main(int argc, char **argv) case Ekeyboard: if(e.kbdc == 'q' || e.kbdc == 0x7F) exits(nil); - eresized(0); break; case Emouse: break; |