From a418af36cbd61f4bd72fbe10dd20ca1feb49d9eb Mon Sep 17 00:00:00 2001 From: Valentin Radu Date: Fri, 4 Mar 2022 00:29:11 +0200 Subject: [PATCH] StartUI: Fixed a bug that prevented the menu from updating its position when the settings changed --- ExplorerPatcher/dllmain.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/ExplorerPatcher/dllmain.c b/ExplorerPatcher/dllmain.c index a5fdf0c..9df1a44 100644 --- a/ExplorerPatcher/dllmain.c +++ b/ExplorerPatcher/dllmain.c @@ -9254,14 +9254,19 @@ void StartMenu_LoadSettings(BOOL bRestartIfChanged) dwStartShowClassicMode = dwVal; dwSize = sizeof(DWORD); + dwVal = 0; RegQueryValueExW( hKey, TEXT("TaskbarAl"), 0, NULL, - &dwTaskbarAl, + &dwVal, &dwSize ); + if (InterlockedExchange64(&dwTaskbarAl, dwVal) != dwVal) + { + StartUI_EnableRoundedCornersApply = TRUE; + } RegCloseKey(hKey); } @@ -9534,10 +9539,11 @@ int StartUI_SetWindowRgn(HWND hWnd, HRGN hRgn, BOOL bRedraw) if (SUCCEEDED(hr)) { ShowWindow(hWnd, bIsWindowVisible ? SW_SHOW : SW_HIDE); - if (bIsWindowVisible && StartUI_EnableRoundedCornersApply) + DWORD TaskbarAl = InterlockedAdd(&dwTaskbarAl, 0); + if (bIsWindowVisible && (!TaskbarAl ? StartUI_EnableRoundedCornersApply : 1)) { HWND hWndTaskbar = NULL; - if (InterlockedAdd(&dwTaskbarAl, 0)) + if (TaskbarAl) { HWND hWndTemp = NULL;