mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-06-08 01:52:52 +08:00
[MouseUtils]Workaround taskbar transparency glitch (#17085)
This commit is contained in:
parent
bad435bb26
commit
5914fc1ffd
@ -497,7 +497,8 @@ void SuperSonar<D>::StartSonar()
|
|||||||
Logger::info("Focusing the sonar on the mouse cursor.");
|
Logger::info("Focusing the sonar on the mouse cursor.");
|
||||||
Trace::MousePointerFocused();
|
Trace::MousePointerFocused();
|
||||||
// Cover the entire virtual screen.
|
// 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;
|
m_sonarPos = ptNowhere;
|
||||||
OnMouseTimer();
|
OnMouseTimer();
|
||||||
UpdateMouseSnooping();
|
UpdateMouseSnooping();
|
||||||
|
@ -150,8 +150,9 @@ void Highlighter::AddDrawingPoint(MouseButton button)
|
|||||||
// Perhaps add a task to the Dispatcher every X circles to clean up.
|
// Perhaps add a task to the Dispatcher every X circles to clean up.
|
||||||
|
|
||||||
// Get back on top in case other Window is now the topmost.
|
// Get back on top in case other Window is now the topmost.
|
||||||
|
// 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),
|
SetWindowPos(m_hwnd, HWND_TOPMOST, GetSystemMetrics(SM_XVIRTUALSCREEN), GetSystemMetrics(SM_YVIRTUALSCREEN),
|
||||||
GetSystemMetrics(SM_CXVIRTUALSCREEN), GetSystemMetrics(SM_CYVIRTUALSCREEN), 0);
|
GetSystemMetrics(SM_CXVIRTUALSCREEN), GetSystemMetrics(SM_CYVIRTUALSCREEN)-1, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Highlighter::UpdateDrawingPointPosition(MouseButton button)
|
void Highlighter::UpdateDrawingPointPosition(MouseButton button)
|
||||||
@ -259,8 +260,10 @@ void Highlighter::StartDrawing()
|
|||||||
Logger::info("Starting draw mode.");
|
Logger::info("Starting draw mode.");
|
||||||
Trace::StartHighlightingSession();
|
Trace::StartHighlightingSession();
|
||||||
m_visible = true;
|
m_visible = true;
|
||||||
|
|
||||||
|
// 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),
|
SetWindowPos(m_hwnd, HWND_TOPMOST, GetSystemMetrics(SM_XVIRTUALSCREEN), GetSystemMetrics(SM_YVIRTUALSCREEN),
|
||||||
GetSystemMetrics(SM_CXVIRTUALSCREEN), GetSystemMetrics(SM_CYVIRTUALSCREEN), 0);
|
GetSystemMetrics(SM_CXVIRTUALSCREEN), GetSystemMetrics(SM_CYVIRTUALSCREEN)-1, 0);
|
||||||
ClearDrawing();
|
ClearDrawing();
|
||||||
ShowWindow(m_hwnd, SW_SHOWNOACTIVATE);
|
ShowWindow(m_hwnd, SW_SHOWNOACTIVATE);
|
||||||
m_mouseHook = SetWindowsHookEx(WH_MOUSE_LL, MouseHookProc, m_hinstance, 0);
|
m_mouseHook = SetWindowsHookEx(WH_MOUSE_LL, MouseHookProc, m_hinstance, 0);
|
||||||
|
@ -247,7 +247,8 @@ void InclusiveCrosshairs::StartDrawing()
|
|||||||
{
|
{
|
||||||
Logger::info("Start drawing crosshairs.");
|
Logger::info("Start drawing crosshairs.");
|
||||||
Trace::StartDrawingCrosshairs();
|
Trace::StartDrawingCrosshairs();
|
||||||
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);
|
||||||
UpdateCrosshairsPosition();
|
UpdateCrosshairsPosition();
|
||||||
ShowWindow(m_hwnd, SW_SHOWNOACTIVATE);
|
ShowWindow(m_hwnd, SW_SHOWNOACTIVATE);
|
||||||
m_visible = true;
|
m_visible = true;
|
||||||
|
Loading…
Reference in New Issue
Block a user