From b780ac2cea0e78e308874c9436bee3a5991e3b44 Mon Sep 17 00:00:00 2001 From: hamid <65052613+hxmid@users.noreply.github.com> Date: Thu, 27 Aug 2026 02:16:42 +1000 Subject: [PATCH 1/2] Adjust start button alignment for Windows 11 --- Src/StartMenu/StartMenuDLL/StartMenuDLL.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Src/StartMenu/StartMenuDLL/StartMenuDLL.cpp b/Src/StartMenu/StartMenuDLL/StartMenuDLL.cpp index 4a9786f3e..9c95e2e74 100644 --- a/Src/StartMenu/StartMenuDLL/StartMenuDLL.cpp +++ b/Src/StartMenu/StartMenuDLL/StartMenuDLL.cpp @@ -1345,7 +1345,8 @@ static void UpdateStartButtonPosition(const TaskbarInfo* taskBar, const WINDOWPO // 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) && !g_epTaskbar) + // We should also shift custom icons, as they're incorrectly aligned to the left edge on Windows 11 + if (IsWin11() && (x == info.rcMonitor.left) && (GetStartButtonType() == START_BUTTON_AERO || GetStartButtonType() == START_BUTTON_CUSTOM) && !g_epTaskbar) x += ScaleForDpi(taskBar->taskBar, 6); } From 6397cceb830da7e83b76ce797f86a2d94ea051e3 Mon Sep 17 00:00:00 2001 From: hamid Date: Thu, 27 Aug 2026 03:57:00 +1000 Subject: [PATCH 2/2] added setting for start button offset --- Src/StartMenu/StartMenuDLL/SettingsUI.cpp | 6 ++++-- Src/StartMenu/StartMenuDLL/StartMenuDLL.cpp | 18 +++++++++++------- Src/StartMenu/StartMenuDLL/StartMenuDLL.rc | 2 ++ Src/StartMenu/StartMenuDLL/resource.h | 2 ++ 4 files changed, 19 insertions(+), 9 deletions(-) diff --git a/Src/StartMenu/StartMenuDLL/SettingsUI.cpp b/Src/StartMenu/StartMenuDLL/SettingsUI.cpp index 49383601b..fa79c30e3 100644 --- a/Src/StartMenu/StartMenuDLL/SettingsUI.cpp +++ b/Src/StartMenu/StartMenuDLL/SettingsUI.cpp @@ -4456,6 +4456,7 @@ CSetting g_Settings[]={ {L"CustomButton",CSetting::TYPE_RADIO,IDS_CUSTOM_BUTTON,IDS_CUSTOM_BUTTON_TIP}, {L"StartButtonPath",CSetting::TYPE_BITMAP,IDS_BUTTON_IMAGE,IDS_BUTTON_IMAGE_TIP,L"",0,L"#StartButtonType=2",L"CustomButton"}, {L"StartButtonSize",CSetting::TYPE_INT,IDS_BUTTON_SIZE,IDS_BUTTON_SIZE_TIP2,0,0,L"#StartButtonType=2",L"CustomButton"}, + {L"StartButtonOffset",CSetting::TYPE_INT,IDS_BUTTON_OFFSET,IDS_BUTTON_OFFSET_TIP,0,0,L"#StartButtonType=2",L"CustomButton"}, {L"StartButtonAlign",CSetting::TYPE_BOOL,IDS_BUTTON_ALIGN,IDS_BUTTON_ALIGN_TIP,0,0,L"#StartButtonType=2",L"CustomButton"}, {L"StartButtonIcon",CSetting::TYPE_ICON,IDS_BUTTON_ICON,IDS_BUTTON_ICON_TIP,L",1",0,L"#StartButtonType=1",L"ClasicButton"}, {L"StartButtonIconSize",CSetting::TYPE_INT,IDS_BUTTON_ICON_SIZE,IDS_BUTTON_ICON_SIZE_TIP,0,0,L"#StartButtonType=1",L"ClasicButton"}, @@ -5157,7 +5158,7 @@ void InitSettings( void ) InitSettings(g_Settings,COMPONENT_MENU,&g_CustomSettings); } -static int g_ButtonPath, g_ButtonSize, g_ButtonIcon, g_ButtonIconSize, g_ButtonText, g_ButtonTip; +static int g_ButtonPath, g_ButtonSize, g_ButtonIcon, g_ButtonOffset, g_ButtonIconSize, g_ButtonText, g_ButtonTip; static bool g_bButtonEnable, g_bTaskbarsChanged, g_bTaskbarsUpdated; static void StoreButtonSettings( void ) @@ -5175,6 +5176,7 @@ static void StoreButtonSettings( void ) if (g_ButtonPath==START_BUTTON_CUSTOM) g_ButtonPath=CalcFNVHash(GetSettingString(L"StartButtonPath")); g_ButtonSize=GetSettingInt(L"StartButtonSize"); + g_ButtonOffset = GetSettingInt(L"StartButtonOffset"); g_ButtonIconSize=GetSettingInt(L"StartButtonIconSize"); } @@ -5191,7 +5193,7 @@ static void UpdateButtons( bool bForce ) } if (path==START_BUTTON_CUSTOM) path=CalcFNVHash(GetSettingString(L"StartButtonPath")); - bool bRecreate=(g_bButtonEnable!=GetSettingBool(L"EnableStartButton") || path!=g_ButtonPath || g_ButtonSize!=GetSettingInt(L"StartButtonSize") + bool bRecreate = (g_bButtonEnable != GetSettingBool(L"EnableStartButton") || path != g_ButtonPath || g_ButtonSize != GetSettingInt(L"StartButtonSize") || g_ButtonOffset != GetSettingInt(L"StartButtonOffset") || g_ButtonIcon!=icon || g_ButtonIconSize!=GetSettingInt(L"StartButtonIconSize") || g_ButtonText!=text || g_ButtonTip!=tip); if ((g_bTaskbarsChanged && !g_bTaskbarsUpdated) || bForce || bRecreate) { diff --git a/Src/StartMenu/StartMenuDLL/StartMenuDLL.cpp b/Src/StartMenu/StartMenuDLL/StartMenuDLL.cpp index 9c95e2e74..1891b0e9b 100644 --- a/Src/StartMenu/StartMenuDLL/StartMenuDLL.cpp +++ b/Src/StartMenu/StartMenuDLL/StartMenuDLL.cpp @@ -498,8 +498,8 @@ class CStartMenuTarget: public IDropTarget return E_NOINTERFACE; } - virtual ULONG STDMETHODCALLTYPE AddRef( void ) - { + virtual ULONG STDMETHODCALLTYPE AddRef( void ) + { return InterlockedIncrement(&m_RefCount); } @@ -1345,9 +1345,13 @@ static void UpdateStartButtonPosition(const TaskbarInfo* taskBar, const WINDOWPO // Start button on Win11 is a bit shifted to the right // We will shift our Aero button to cover original button - // We should also shift custom icons, as they're incorrectly aligned to the left edge on Windows 11 - if (IsWin11() && (x == info.rcMonitor.left) && (GetStartButtonType() == START_BUTTON_AERO || GetStartButtonType() == START_BUTTON_CUSTOM) && !g_epTaskbar) - x += ScaleForDpi(taskBar->taskBar, 6); + if (IsWin11() && (x == info.rcMonitor.left) && !g_epTaskbar) { + if (GetStartButtonType() == START_BUTTON_AERO) + x += ScaleForDpi(taskBar->taskBar, 6); + // we should also be able to shift our custom icon, as it's also incorrectly aligned to the left edge on Windows 11 + else if (GetStartButtonType() == START_BUTTON_CUSTOM) + x += ScaleForDpi(taskBar->taskBar, GetSettingInt(L"StartButtonOffset")); + } } RECT rcButton = { x, y, x + taskBar->startButtonSize.cx, y + taskBar->startButtonSize.cy }; @@ -2390,7 +2394,7 @@ void UpdateTaskBars( TUpdateTaskbar update ) { if (bDefColor && GetWinVersion()>WIN_VER_WIN7) { - if (IsAppThemed()) + if (IsAppThemed()) { color=GetSystemGlassColor8(); color=((color&0xFF)<<16)|(color&0xFF00)|((color>>16)&0xFF); @@ -4307,7 +4311,7 @@ HBITMAP GetStartScreenIcon( int size ) } SelectObject(hDst,bmp0); DeleteDC(hDst); - + int i=0; int n=size*rc.top; for (;i