]> granicus.if.org Git - nethack/commitdiff
Qt extended command entry
authorPatR <rankin@nethack.org>
Sat, 16 Apr 2022 21:53:43 +0000 (14:53 -0700)
committerPatR <rankin@nethack.org>
Sat, 16 Apr 2022 21:53:43 +0000 (14:53 -0700)
For Qt with 'popup_dialog' off, if I typed "#quit" then the prompt
"Really quit?" was displayed in the message window as expected.
But if I typed "#" and then clicked on [quit], sometimes the prompt
wasn't visible even though the program was waiting for me to answer
it.  I've noticed this a time or two in the past and just pretended
that it hadn't happened; since I usually enter extended commands by
typing their name, it didn't stand out much.  Testing #repeat with
extended commands brought it back to mind.

I don't understand what's going on, but this one-line patch seems
to solve it.  (With a multi-line message window, clear_nhwindow()
doesn't erase anything, but for Qt it does update the most recent
entry.)

win/Qt/qt_bind.cpp

index f5592b504ab836293f159ea8f1e185302f3c109e..5039f65410021ef23cabc39bc2d9d06a647ff23b 100644 (file)
@@ -841,6 +841,8 @@ int NetHackQtBind::qt_get_ext_cmd()
         result = xcmd->get();
         delete xcmd;
     } while (result == xcmdNoMatch);
+    // refresh message window after extended command dialog is dismissed
+    NetHackQtBind::qt_clear_nhwindow(WIN_MESSAGE);
     return result;
 }