From 2de0c8cacbc1be9e8d677ea386bdd0463c0c82fb Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Mon, 4 Mar 2024 11:37:06 +0200 Subject: [PATCH] Qt: make all menus modal This fixes a lot of problems where a menu or a text window was up and the main window accepted input - for example you could move around, making another window of the same type pop up ... --- doc/fixes3-7-0.txt | 1 + win/Qt/qt_menu.cpp | 2 ++ 2 files changed, 3 insertions(+) diff --git a/doc/fixes3-7-0.txt b/doc/fixes3-7-0.txt index 4e802b0ec..b4120a80b 100644 --- a/doc/fixes3-7-0.txt +++ b/doc/fixes3-7-0.txt @@ -2145,6 +2145,7 @@ Qt: {maybe just Qt+macOS:} when viewing a text window ('V' to look at 'history' window got pushed underneath the main window so seemed to go away Qt: use idPressed signal instead of buttonPressed and mappedString instead of mapped for recent Qt (pr #913 by chasonr) +Qt: make all NetHack menu and text windows modal Qt: support Unicode supplementary characters (pr #1047 by chasonr) Qt: qt_tilewidth and qt_tileheight are allocated with alloc() and need to be freed with free(); don't use qt_tilewidth and qt_tileheight after diff --git a/win/Qt/qt_menu.cpp b/win/Qt/qt_menu.cpp index 047ab73c6..f7480ecbc 100644 --- a/win/Qt/qt_menu.cpp +++ b/win/Qt/qt_menu.cpp @@ -220,6 +220,7 @@ NetHackQtMenuWindow::NetHackQtMenuWindow(QWidget *parent) : this, SLOT(TableCellClicked(int,int))); setLayout(grid); + setModal(true); } NetHackQtMenuWindow::~NetHackQtMenuWindow() @@ -1013,6 +1014,7 @@ NetHackQtTextWindow::NetHackQtTextWindow(QWidget *parent) : setFocusPolicy(Qt::StrongFocus); // needed so that keystrokes get sent to our keyPressEvent() lines->setFocusPolicy(Qt::NoFocus); + setModal(true); } void NetHackQtTextWindow::doUpdate()