aboutsummaryrefslogtreecommitdiff
path: root/musw.c
diff options
context:
space:
mode:
authorrodri <rgl@antares-labs.eu>2021-07-29 14:56:10 +0000
committerrodri <rgl@antares-labs.eu>2021-07-29 14:56:10 +0000
commit3241d4b8c80f9424a3f725b5905def22916fc854 (patch)
tree2240ce49ee442db534161f8cf4de1640e3dd0408 /musw.c
parent9942eb201a657640cf244b261008b850352a29f3 (diff)
downloadmusw-3241d4b8c80f9424a3f725b5905def22916fc854.tar.gz
musw-3241d4b8c80f9424a3f725b5905def22916fc854.tar.bz2
musw-3241d4b8c80f9424a3f725b5905def22916fc854.zip
made the client window size immutable.
added some dev notes to a file. renamed Lobby.healthcheck to Lobby.purge, which makes more sense.
Diffstat (limited to 'musw.c')
-rw-r--r--musw.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/musw.c b/musw.c
index 39c707a..fddec50 100644
--- a/musw.c
+++ b/musw.c
@@ -35,6 +35,7 @@ struct Ball
};
Ball bouncer;
+char winspec[32];
int debug;
@@ -142,6 +143,8 @@ redraw(void)
void
resize(void)
{
+ int fd;
+
if(debug)
fprint(2, "resizing\n");
@@ -149,6 +152,15 @@ resize(void)
if(getwindow(display, Refnone) < 0)
sysfatal("resize failed");
unlockdisplay(display);
+
+ if(Dx(screen->r) != SCRW || Dy(screen->r) != SCRH){
+ fd = open("/dev/wctl", OWRITE);
+ if(fd >= 0){
+ fprint(fd, "resize %s", winspec);
+ close(fd);
+ }
+ }
+
redraw();
}
@@ -178,7 +190,8 @@ threadmain(int argc, char *argv[])
usage();
server = argv[0];
- if(newwindow("-dx 640 -dy 480") < 0)
+ snprint(winspec, sizeof winspec, "-dx %d -dy %d", SCRWB, SCRHB);
+ if(newwindow(winspec) < 0)
sysfatal("newwindow: %r");
if(initdraw(nil, nil, nil) < 0)
sysfatal("initdraw: %r");