aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/devdraw
diff options
context:
space:
mode:
authorRuss Cox <rsc@swtch.com>2020-01-15 11:25:36 -0500
committerRuss Cox <rsc@swtch.com>2020-01-15 11:26:01 -0500
commitfe2b2de9844749c876df209bb8d9413e0074cbcf (patch)
tree14688e805b4930a58c29e8c146e0f009d2a542d1 /src/cmd/devdraw
parentba60bab3cd247284977ff99573db0c1f3d056953 (diff)
downloadplan9port-fe2b2de9844749c876df209bb8d9413e0074cbcf.tar.gz
plan9port-fe2b2de9844749c876df209bb8d9413e0074cbcf.tar.bz2
plan9port-fe2b2de9844749c876df209bb8d9413e0074cbcf.zip
devdraw: set windowrect correctly on x11 if window gets unexpected size
Fixes #54.
Diffstat (limited to 'src/cmd/devdraw')
-rw-r--r--src/cmd/devdraw/x11-screen.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/cmd/devdraw/x11-screen.c b/src/cmd/devdraw/x11-screen.c
index c3a6fa33..d01e8496 100644
--- a/src/cmd/devdraw/x11-screen.c
+++ b/src/cmd/devdraw/x11-screen.c
@@ -550,8 +550,6 @@ xattach(Client *client, char *label, char *winsize)
havemin = 0;
}
w = newxwin(client);
- w->screenrect = Rect(0, 0, WidthOfScreen(xscreen), HeightOfScreen(xscreen));
- w->windowrect = r;
memset(&attr, 0, sizeof attr);
attr.colormap = _x.cmap;
@@ -679,6 +677,8 @@ xattach(Client *client, char *label, char *winsize)
}
}else
fprint(2, "XGetWindowAttributes: bad attrs\n");
+ w->screenrect = Rect(0, 0, WidthOfScreen(xscreen), HeightOfScreen(xscreen));
+ w->windowrect = r;
/*
* Allocate our local backing store.