mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-12-16 11:48:06 +01:00
[MouseUtils]Fix for breaking Windows shortcuts (#17681)
This commit is contained in:
@@ -498,7 +498,7 @@ void SuperSonar<D>::StartSonar()
|
|||||||
Trace::MousePointerFocused();
|
Trace::MousePointerFocused();
|
||||||
// Cover the entire virtual screen.
|
// Cover the entire virtual screen.
|
||||||
// HACK: Draw with 1 pixel off. Otherwise Windows glitches the task bar transparency when a transparent window fill the whole screen.
|
// 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);
|
SetWindowPos(m_hwnd, HWND_TOPMOST, GetSystemMetrics(SM_XVIRTUALSCREEN) + 1, GetSystemMetrics(SM_YVIRTUALSCREEN) + 1, GetSystemMetrics(SM_CXVIRTUALSCREEN) - 2, GetSystemMetrics(SM_CYVIRTUALSCREEN) - 2, 0);
|
||||||
m_sonarPos = ptNowhere;
|
m_sonarPos = ptNowhere;
|
||||||
OnMouseTimer();
|
OnMouseTimer();
|
||||||
UpdateMouseSnooping();
|
UpdateMouseSnooping();
|
||||||
|
|||||||
@@ -151,8 +151,7 @@ void Highlighter::AddDrawingPoint(MouseButton button)
|
|||||||
|
|
||||||
// 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.
|
// 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) + 1, GetSystemMetrics(SM_YVIRTUALSCREEN) + 1, GetSystemMetrics(SM_CXVIRTUALSCREEN) - 2, GetSystemMetrics(SM_CYVIRTUALSCREEN) - 2, 0);
|
||||||
GetSystemMetrics(SM_CXVIRTUALSCREEN), GetSystemMetrics(SM_CYVIRTUALSCREEN)-1, 0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Highlighter::UpdateDrawingPointPosition(MouseButton button)
|
void Highlighter::UpdateDrawingPointPosition(MouseButton button)
|
||||||
@@ -262,8 +261,7 @@ void Highlighter::StartDrawing()
|
|||||||
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.
|
// 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) + 1, GetSystemMetrics(SM_YVIRTUALSCREEN) + 1, GetSystemMetrics(SM_CXVIRTUALSCREEN) - 2, GetSystemMetrics(SM_CYVIRTUALSCREEN) - 2, 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);
|
||||||
|
|||||||
@@ -175,6 +175,9 @@ void InclusiveCrosshairs::UpdateCrosshairsPosition()
|
|||||||
{
|
{
|
||||||
POINT ptCursor;
|
POINT ptCursor;
|
||||||
|
|
||||||
|
// 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) + 1, GetSystemMetrics(SM_YVIRTUALSCREEN) + 1, GetSystemMetrics(SM_CXVIRTUALSCREEN) - 2, GetSystemMetrics(SM_CYVIRTUALSCREEN) - 2, 0);
|
||||||
|
|
||||||
GetCursorPos(&ptCursor);
|
GetCursorPos(&ptCursor);
|
||||||
|
|
||||||
HMONITOR cursorMonitor = MonitorFromPoint(ptCursor, MONITOR_DEFAULTTONEAREST);
|
HMONITOR cursorMonitor = MonitorFromPoint(ptCursor, MONITOR_DEFAULTTONEAREST);
|
||||||
@@ -247,8 +250,6 @@ void InclusiveCrosshairs::StartDrawing()
|
|||||||
{
|
{
|
||||||
Logger::info("Start drawing crosshairs.");
|
Logger::info("Start drawing crosshairs.");
|
||||||
Trace::StartDrawingCrosshairs();
|
Trace::StartDrawingCrosshairs();
|
||||||
// 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;
|
||||||
|
|||||||
Reference in New Issue
Block a user