From f6e151265c43da7cdc55af1b4d97346d0aa0dd0c Mon Sep 17 00:00:00 2001 From: Sally Knight Date: Tue, 24 Mar 2026 07:00:21 +0300 Subject: [PATCH] fix(jui): mouse unlocking while in a screen --- Minecraft.Client/Minecraft.cpp | 33 +++++++++++---------------------- 1 file changed, 11 insertions(+), 22 deletions(-) diff --git a/Minecraft.Client/Minecraft.cpp b/Minecraft.Client/Minecraft.cpp index 3bf786ec2..92f4ae5f7 100644 --- a/Minecraft.Client/Minecraft.cpp +++ b/Minecraft.Client/Minecraft.cpp @@ -597,29 +597,18 @@ void Minecraft::setScreen(Screen* screen) { // 4J-PB - if a screen has been set, go into menu mode // it's possible that player doesn't exist here yet - /*if(screen!=NULL) - { - if(player && player->GetXboxPad()!=-1) - { - InputManager.SetMenuDisplayed(player->GetXboxPad(),true); + // 4jcraft: reuse this for the java GUI +#ifdef ENABLE_JAVA_GUIS + if (screen != NULL && player != NULL) { + if (player && player->GetXboxPad() != -1) { + InputManager.SetMenuDisplayed(player->GetXboxPad(), true); + } + } else if (player != NULL) { + if (player && player->GetXboxPad() != -1) { + InputManager.SetMenuDisplayed(player->GetXboxPad(), false); + } } - else - { - // set all - //InputManager.SetMenuDisplayed(XUSER_INDEX_ANY,true); - } - } - else - { - if(player && player->GetXboxPad()!=-1) - { - InputManager.SetMenuDisplayed(player->GetXboxPad(),false); - } - else - { - //InputManager.SetMenuDisplayed(XUSER_INDEX_ANY,false); - } - }*/ +#endif } void Minecraft::checkGlError(const std::wstring& string) {