From: keni Date: Tue, 10 Jan 2012 02:33:36 +0000 (+0000) Subject: another shot at H2344 (large window) X-Git-Tag: MOVE2GIT~99 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=92b15c5f8a1a3309c592d3d56597ffd1cb0ed6b2;p=nethack another shot at H2344 (large window) Conditional on H2344_BROKEN which can be disabled at the top of the file if necessary. This appears to handle all the cases I was able to reproduce from Pat's list, with the caveat that msg_window=f fails on very wide windows on Mac OSX Lion with the default terminal emulation. When the emulation is set to ANSI, it works (the failure mode is the output from a simple putchar() loop across the contents of history called up from ^P wraps at about the middle of the window). --- diff --git a/doc/fixes35.0 b/doc/fixes35.0 index 2220ed607..f185bc4c5 100644 --- a/doc/fixes35.0 +++ b/doc/fixes35.0 @@ -429,6 +429,7 @@ platforms that support hangup: SAFERHANGUP to avoid losing objects in transit well-timed hangups to stop a long melee X11: support dynamic switching of map mode via tiled_map option X11: added support for hilite_pet to text map mode +tty: various bugfixes for very wide and/or tall screens General New Features diff --git a/win/tty/wintty.c b/win/tty/wintty.c index 2c8b005f8..8347945d5 100644 --- a/win/tty/wintty.c +++ b/win/tty/wintty.c @@ -9,6 +9,12 @@ * h+ 930227 */ +/* It's still not clear I've caught all the cases for H2344. #undef this + * to back out the changes. */ +#define H2344_BROKEN + +#include + #include "hack.h" #include "dlb.h" #include "date.h" @@ -1806,7 +1812,7 @@ tty_display_nhwindow(window, blocking) */ cw->offx = (cw->type==NHW_TEXT) ? 0 - : min(10, ttyDisplay->cols - cw->maxcol - 1); + : min( min(82,ttyDisplay->cols/2), ttyDisplay->cols - cw->maxcol - 1); #else /* avoid converting to uchar before calculations are finished */ cw->offx = (uchar) (int) @@ -2194,7 +2200,12 @@ tty_putstr_core(window, attr, symstr) break; case NHW_MENU: case NHW_TEXT: - if(cw->type == NHW_TEXT && cw->cury == ttyDisplay->rows-1) { +#ifdef H2344_BROKEN + if(cw->type == NHW_TEXT && (cw->cury+cw->offy) == ttyDisplay->rows-1) +#else + if(cw->type == NHW_TEXT && cw->cury == ttyDisplay->rows-1) +#endif + { /* not a menu, so save memory and output 1 page at a time */ cw->maxcol = ttyDisplay->cols; /* force full-screen mode */ tty_display_nhwindow(window, TRUE);