From e0e9d1d8b2c2517e59d64298b79aeaa81eba9306 Mon Sep 17 00:00:00 2001 From: PatR Date: Fri, 24 Mar 2023 17:51:21 -0700 Subject: [PATCH] curses: message window border w/ align_status:left This fixes the missing message window border when restoring with align_status:left (which narrows and forces that window to the right). It can't possibly be the correct way to fix things but does work. This was not a problem with 3.6.4 (the most recent pre-3.7 playground I have on hand) but I don't have the energy to use 'git bisect' to track done when it started to whether the cause is discernable. The message history is put into place without going through putstr() so differs from normal message handling. --- doc/fixes3-7-0.txt | 3 +++ win/curses/cursmesg.c | 16 ++++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/doc/fixes3-7-0.txt b/doc/fixes3-7-0.txt index 83463ef36..29f5c765d 100644 --- a/doc/fixes3-7-0.txt +++ b/doc/fixes3-7-0.txt @@ -1539,6 +1539,9 @@ curses: typing ESC to cancel something issued a beep; if the terminal was set to 'visible bell', the screen flashed; only beep when the ESC is part of an escape sequence--other than M-c generating ESC c--and nethack is expecting text rather than a command or direction +curses: with window borders on and align_status:left, restoring brought up a + screen where the message window's border wasn't shown; once it needed + to be scrolled to fit a new message, the border appeared Qt: at Xp levels above 20 with 'showexp' On, the combined status field "Level:NN/nnnnnnnn" was too big and truncated by a char at each end Qt: searching a text window for something that wasn't found and then searching diff --git a/win/curses/cursmesg.c b/win/curses/cursmesg.c index 0873f9b8d..42f6825a3 100644 --- a/win/curses/cursmesg.c +++ b/win/curses/cursmesg.c @@ -984,6 +984,22 @@ curses_putmsghistory(const char *msg, boolean restoring_msghist) } initd = FALSE; /* reset */ } + + /* + * FIXME: + * restoring a game with window borders on and align_status:left + * (which pushes the starting column of the message window to the + * right) brings up an initial display where the border around + * the message window is missing. Once a new message causes it + * to be scrolled, its border appears. This absurd hack forces + * that to be shown right away. + */ + if (restoring_msghist && curses_window_has_border(WIN_MESSAGE)) { + WINDOW *win = curses_get_nhwin(WIN_MESSAGE); + + box(win, 0, 0); + wrefresh(win); + } } /*cursmesg.c*/