[MouseUtils]Workaround taskbar transparency glitch (#17085)

This commit is contained in:
Jaime Bernardo
2022-03-17 17:25:15 +00:00
committed by GitHub
parent bad435bb26
commit 5914fc1ffd
3 changed files with 9 additions and 4 deletions

View File

@@ -497,7 +497,8 @@ void SuperSonar<D>::StartSonar()
Logger::info("Focusing the sonar on the mouse cursor.");
Trace::MousePointerFocused();
// Cover the entire virtual screen.
SetWindowPos(m_hwnd, HWND_TOPMOST, GetSystemMetrics(SM_XVIRTUALSCREEN), GetSystemMetrics(SM_YVIRTUALSCREEN), GetSystemMetrics(SM_CXVIRTUALSCREEN), GetSystemMetrics(SM_CYVIRTUALSCREEN), 0);
// HACK: Draw with 1 pixel off. Otherwise Windows glitches the task bar transparency when a transparent window fill the whole screen.
SetWindowPos(m_hwnd, HWND_TOPMOST, GetSystemMetrics(SM_XVIRTUALSCREEN), GetSystemMetrics(SM_YVIRTUALSCREEN), GetSystemMetrics(SM_CXVIRTUALSCREEN), GetSystemMetrics(SM_CYVIRTUALSCREEN)-1, 0);
m_sonarPos = ptNowhere;
OnMouseTimer();
UpdateMouseSnooping();