From 4705b35694f0a6256ced130d5ac99cbb60880da0 Mon Sep 17 00:00:00 2001 From: ge0rdi Date: Mon, 30 Jan 2023 19:21:15 +0100 Subject: [PATCH] Fix Aero button alignment on multiple monitors (#1310) Shift Aero button slightly when it is positioned in corner of any monitor (not just primary one). Moreover this shift should be done only for top/bottom taskbar. --- Src/StartMenu/StartMenuDLL/StartMenuDLL.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Src/StartMenu/StartMenuDLL/StartMenuDLL.cpp b/Src/StartMenu/StartMenuDLL/StartMenuDLL.cpp index 9be1119..278f3bc 100644 --- a/Src/StartMenu/StartMenuDLL/StartMenuDLL.cpp +++ b/Src/StartMenu/StartMenuDLL/StartMenuDLL.cpp @@ -1313,12 +1313,12 @@ static void UpdateStartButtonPosition(const TaskbarInfo* taskBar, const WINDOWPO y = rcTask.top; else y = rcTask.bottom - taskBar->startButtonSize.cy; - } - // Start button on Win11 is a bit shifted to the right - // We will shift our Aero button to cover original button - if (IsWin11() && (x == 0) && (GetStartButtonType() == START_BUTTON_AERO)) - x += ScaleForDpi(taskBar->taskBar, 6); + // Start button on Win11 is a bit shifted to the right + // We will shift our Aero button to cover original button + if (IsWin11() && (x == info.rcMonitor.left) && (GetStartButtonType() == START_BUTTON_AERO)) + x += ScaleForDpi(taskBar->taskBar, 6); + } RECT rcButton = { x, y, x + taskBar->startButtonSize.cx, y + taskBar->startButtonSize.cy }; RECT rc;