fix: 小优化

This commit is contained in:
Xu 2025-12-21 19:36:49 +08:00
commit eb1fffaf65
2 changed files with 1 additions and 4 deletions

View file

@ -3,9 +3,6 @@
#include "DeviceResources.h"
#include "Logger.h"
#include "ScalingWindow.h"
#include "Win32Helper.h"
#include <dcomp.h>
#include <dwmapi.h>
namespace Magpie {

View file

@ -1984,7 +1984,7 @@ winrt::fire_and_forget ScalingWindow::_UpdateFocusStateAsync() const noexcept {
}
}
if (isForeMovable && hwndFore) {
if (isForeMovable && hwndFore && GetForegroundWindow() == hwndFore) {
SetWindowPos(hwndFore, HWND_TOP, 0, 0, 0, 0, SWP_NO_ACTIVATE_MOVE_SIZE);
}
}