diff --git a/src/Magpie.Core/OverlayDrawer.cpp b/src/Magpie.Core/OverlayDrawer.cpp index f7bfe687..81355072 100644 --- a/src/Magpie.Core/OverlayDrawer.cpp +++ b/src/Magpie.Core/OverlayDrawer.cpp @@ -261,7 +261,8 @@ void OverlayDrawer::SetUIVisibility(bool value, bool noSetForeground) noexcept { _isUIVisiable = value; if (value) { - if (ScalingWindow::Get().Options().Is3DGameMode()) { + _openWith3DGameMode = ScalingWindow::Get().Options().Is3DGameMode(); + if (_openWith3DGameMode) { // 使全屏窗口不透明且可以接收焦点 HWND hwndHost = ScalingWindow::Get().Handle(); INT_PTR style = GetWindowLongPtr(hwndHost, GWL_EXSTYLE); @@ -278,7 +279,7 @@ void OverlayDrawer::SetUIVisibility(bool value, bool noSetForeground) noexcept { _imguiImpl.ClearStates(); } - if (ScalingWindow::Get().Options().Is3DGameMode()) { + if (_openWith3DGameMode) { // 还原全屏窗口样式 HWND hwndHost = ScalingWindow::Get().Handle(); INT_PTR style = GetWindowLongPtr(hwndHost, GWL_EXSTYLE); diff --git a/src/Magpie.Core/OverlayDrawer.h b/src/Magpie.Core/OverlayDrawer.h index 8a6ae7c5..5e567199 100644 --- a/src/Magpie.Core/OverlayDrawer.h +++ b/src/Magpie.Core/OverlayDrawer.h @@ -87,6 +87,7 @@ class OverlayDrawer { bool _isUIVisiable = false; bool _isFirstFrame = true; + bool _openWith3DGameMode; }; }