From e18465bff0e56b3997660292d71307fd183fda88 Mon Sep 17 00:00:00 2001 From: Noah Brie Date: Mon, 12 Jan 2026 20:21:52 -0500 Subject: [PATCH] Made it so the focused menu is now brought automatically to the front. --- apps/openmw/mwgui/windowmanagerimp.cpp | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/apps/openmw/mwgui/windowmanagerimp.cpp b/apps/openmw/mwgui/windowmanagerimp.cpp index ffc0705b03..b954e104f8 100644 --- a/apps/openmw/mwgui/windowmanagerimp.cpp +++ b/apps/openmw/mwgui/windowmanagerimp.cpp @@ -12,6 +12,7 @@ #include #include #include +#include #include #include @@ -981,6 +982,10 @@ namespace MWGui MWBase::Environment::get().getInputManager()->setGamepadGuiCursorEnabled( mGuiModeStates[mode].mWindows[activeIndex]->isGamepadCursorAllowed()); + WindowBase* activeWindow = mGuiModeStates[mode].mWindows[activeIndex]; + if (activeWindow->isVisible()) + MyGUI::LayerManager::getInstance().upLayerItem(activeWindow->mMainWidget); + updateControllerButtonsOverlay(); setCursorActive(false); @@ -1435,11 +1440,17 @@ namespace MWGui if (Settings::gui().mControllerMenus) { if (mode == GM_Container) - mActiveControllerWindows[mode] = 0; // Ensure controller focus is on container - // Activate first visible window. This needs to be called after updateVisible. - if (mActiveControllerWindows[mode] != 0) - mActiveControllerWindows[mode] = mActiveControllerWindows[mode] - 1; - cycleActiveControllerWindow(true); + { + // Ensure controller focus is on container when entering container mode. + setActiveControllerWindow(mode, 0); + } + else + { + // Activate first visible window. This needs to be called after updateVisible. + if (mActiveControllerWindows[mode] != 0) + mActiveControllerWindows[mode] = mActiveControllerWindows[mode] - 1; + cycleActiveControllerWindow(true); + } } }