From 2f258f13c7a4ef336f2495378e7426759045b346 Mon Sep 17 00:00:00 2001 From: Jilles Tjoelker Date: Thu, 4 Mar 2004 13:30:12 +0000 Subject: [PATCH] Use client-supplied window size again (Pasi Kallinen). Try to detect broken clients and force them to 80x24. This backs out the functional change in rev 247. Passing through window size to watchers in a later commit. git-svn-id: svn://katsu.triplehelix.org/dgamelaunch/trunk@264 db0b04b0-f4d1-0310-9a6d-de3e77497b0e --- dgamelaunch.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/dgamelaunch.c b/dgamelaunch.c index 489db19..c7be452 100644 --- a/dgamelaunch.c +++ b/dgamelaunch.c @@ -1413,10 +1413,14 @@ main (int argc, char** argv) signal (SIGHUP, catch_sighup); (void) tcgetattr (0, &tt); - win.ws_row = 24; - win.ws_col = 80; - win.ws_xpixel = win.ws_col * 8; - win.ws_ypixel = win.ws_row * 8; + if (-1 == ioctl (0, TIOCGWINSZ, (char *) &win) || win.ws_row < 4 || + win.ws_col < 4) /* Rudimentary validity check */ + { + win.ws_row = 24; + win.ws_col = 80; + win.ws_xpixel = win.ws_col * 8; + win.ws_ypixel = win.ws_row * 8; + } /* get master tty just before chroot (lives in /dev) */ ttyrec_getpty (); -- 2.47.3