summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@gmx.de>2013-06-17 08:05:04 +0200
committercinap_lenrek <cinap_lenrek@gmx.de>2013-06-17 08:05:04 +0200
commit9369f83bcdab140fbf485074654994f1ed625588 (patch)
treec5b5d247c201e4586883a4497cfa989e0dc4addc
parent89ed97aaa2ee0eae0042220de288ed02073d4878 (diff)
downloadplan9front-9369f83bcdab140fbf485074654994f1ed625588.tar.xz
page: use resizewin() to change window size for gif display
resizewin() has some extra logic making sure the rect doesnt get too big. rio would otherwise refuse to create the window and the operation will fail completely.
-rw-r--r--sys/src/cmd/page.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/sys/src/cmd/page.c b/sys/src/cmd/page.c
index 70c1bf9d7..0926b8486 100644
--- a/sys/src/cmd/page.c
+++ b/sys/src/cmd/page.c
@@ -1241,12 +1241,9 @@ showext(Page *p)
if(p->ext == nil)
return;
snprint(label, sizeof(label), "%s %s", p->ext, p->label);
- if(p->image){
- ps = subpt(p->image->r.max, p->image->r.min);
- ps.x += 24;
- ps.y += 24;
- } else
- ps = subpt(screen->r.max, screen->r.min);
+ ps = Pt(0, 0);
+ if(p->image)
+ ps = addpt(subpt(p->image->r.max, p->image->r.min), Pt(24, 24));
drawlock(0);
if((fd = p->fd) < 0){
if(p->open != popenfile)
@@ -1257,13 +1254,15 @@ showext(Page *p)
seek(fd, 0, 0);
}
if(rfork(RFPROC|RFMEM|RFFDG|RFNOTEG|RFNAMEG|RFNOWAIT) == 0){
- snprint(buf, sizeof(buf), "-pid %d -dx %d -dy %d", getpid(), ps.x, ps.y);
+ snprint(buf, sizeof(buf), "-pid %d", getpid());
if(newwindow(buf) != -1){
dupfds(fd, 1, 2, -1);
if((fd = open("/dev/label", OWRITE)) >= 0){
write(fd, label, strlen(label));
close(fd);
}
+ if(ps.x && ps.y)
+ resizewin(ps);
argv[0] = "rc";
argv[1] = "-c";
argv[2] = p->ext;