diff --git a/win/Qt/qt_menu.cpp b/win/Qt/qt_menu.cpp index 1a549a8e0..e02cd3d40 100644 --- a/win/Qt/qt_menu.cpp +++ b/win/Qt/qt_menu.cpp @@ -999,6 +999,8 @@ NetHackQtTextWindow::NetHackQtTextWindow(QWidget *parent) : // we don't want keystrokes being sent to the main window for use as // commands while this text window is popped up setFocusPolicy(Qt::StrongFocus); + // needed so that keystrokes get sent to our keyPressEvent() + lines->setFocusPolicy(Qt::NoFocus); } void NetHackQtTextWindow::doUpdate() @@ -1183,11 +1185,12 @@ void NetHackQtTextWindow::Search() // Force text window to be on top. Without this, it moves behind // the map after the string requestor completes. Then it can't // be seen or accessed (unless the game window is minimized or - // possibly dragged out of the way). Unfortunately the window - // noticeably vanishes and then immediately gets redrawn. - if (!this->isActiveWindow()) + // dragged out of the way). Unfortunately the window noticeably + // vanishes and then immediately gets redrawn. + if (!this->isActiveWindow()) { this->activateWindow(); - this->raise(); + this->raise(); + } if (get_a_line) { int linecount = lines->count(); @@ -1226,12 +1229,6 @@ void NetHackQtTextWindow::keyPressEvent(QKeyEvent *key_event) { uchar key = keyValue(key_event); - // - // FIXME: - // Typing ':' doesn't produce ':' so key won't match MENU_SEARCH, - // despite the fact that it does produce ':' for menu input and - // we're calling the exact same code for both types of window...? - // if (key == MENU_SEARCH) { if (!use_rip) Search();