From 28e7cd5c0eed4433eb8b03188936c89eceef9117 Mon Sep 17 00:00:00 2001 From: "nethack.allison" Date: Tue, 2 Apr 2002 01:26:25 +0000 Subject: [PATCH] #741 (from ) Another fatal bug in win32 graphical interface "Too many "dead" NHW_TEXT windows around. Repeating #? 15 times will produce the same result." >Wizard, wearing gray dragon scale mail and wielding Magicbane. The >Dark One teleports next to me and I get the message "The Dark One >casts a spell at you! A field of force surrounds you!". Then I get >3 windows popping up: "Oops." "The dungeon collapses." "ERROR: No >windows available..." and the game exits. > I wish I could reproduce this reliably. Here's the method I've been using > to do it: > > - Equip character (+4 gdsm, Magicbane, unicorn horn, see invisible, > telepathy, key, "gain ability" potions to max out, enhance dagger skill > to max, level change to 14) > - Teleport down to the portal entrance. Go through the portal, get > permission to go down to see the Dark One. > - Go down to the Dark One's level, teleport over, open up his door, and > basically just try to head back to the entrance and kill him. > > Two different things have happened while doing this so far. (I've been > able to get errors something like 5 times out of many tries, and I haven't > been about to do it at all in the TTY version - only the windows > one.) Either I get the above message I mentioned to you, which seems to > happen at a random time, or I get a slightly different result - "Oops, > program initialization failed, ERROR: No windows available". This second > result happened once _after_ I had killed the Dark One and was trying to > #quit. > --- win/win32/mhmenu.c | 6 +++++- win/win32/mswproc.c | 5 ----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/win/win32/mhmenu.c b/win/win32/mhmenu.c index 58f2ae62f..5bcb1f1b6 100644 --- a/win/win32/mhmenu.c +++ b/win/win32/mhmenu.c @@ -9,6 +9,7 @@ #include "mhmain.h" #include "mhmsg.h" #include "mhfont.h" +#include "mhdlg.h" #define MENU_MARGIN 0 #define NHMENU_STR_SIZE BUFSZ @@ -1038,7 +1039,10 @@ BOOL onListChar(HWND hWnd, HWND hwndList, WORD ch) char buf[BUFSZ]; reset_menu_count(hwndList, data); - mswin_getlin("Search for:", buf); + if( mswin_getlin_window("Search for:", buf, BUFSZ)==IDCANCEL ) { + strcpy(buf, "\033"); + } + SetFocus(hwndList); // set focus back to the list control if (!*buf || *buf == '\033') return -2; for(i=0; imenu.size; i++ ) { if( NHMENU_IS_SELECTABLE(data->menu.items[i]) diff --git a/win/win32/mswproc.c b/win/win32/mswproc.c index f08404e64..724ad0f84 100644 --- a/win/win32/mswproc.c +++ b/win/win32/mswproc.c @@ -882,11 +882,6 @@ void mswin_destroy_nhwindow(winid wid) return; } - if (GetNHApp()->windowlist[wid].type == NHW_TEXT) { - /* this type takes care of themself */ - return; - } - if (wid != -1) { if( !GetNHApp()->windowlist[wid].dead && GetNHApp()->windowlist[wid].win != NULL ) -- 2.40.0