From b31605439f2c41237ffec3b5cf511ae51ab8f864 Mon Sep 17 00:00:00 2001 From: Valentin Radu Date: Tue, 14 Dec 2021 23:24:39 +0200 Subject: [PATCH] Seconday taskbars' context menu is displayed similary to the primary taskbar's context menu --- ExplorerPatcher/dllmain.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/ExplorerPatcher/dllmain.c b/ExplorerPatcher/dllmain.c index 00f51be..692484d 100644 --- a/ExplorerPatcher/dllmain.c +++ b/ExplorerPatcher/dllmain.c @@ -2077,9 +2077,14 @@ BOOL explorer_TrackPopupMenuExHook( bContainsOwn = CheckIfMenuContainsOwnPropertiesItem(hMenu); } - if (elapsed > POPUPMENU_EX_ELAPSED || !bFlyoutMenus) + wchar_t wszClassNameOfWindowUnderCursor[200]; + POINT p; p.x = x; p.y = y; + GetClassNameW(WindowFromPoint(p), wszClassNameOfWindowUnderCursor, 200); + BOOL bIsSecondaryTaskbar = (!wcscmp(wszClassName, L"Shell_SecondaryTrayWnd") && !wcscmp(wszClassNameOfWindowUnderCursor, L"Shell_SecondaryTrayWnd")); + + if (elapsed > POPUPMENU_EX_ELAPSED || !bFlyoutMenus || bIsSecondaryTaskbar) { - if (bCenterMenus) + if (bCenterMenus && !bIsSecondaryTaskbar) { PopupMenuAdjustCoordinatesAndFlags(&x, &y, &uFlags); } @@ -2120,7 +2125,10 @@ BOOL explorer_TrackPopupMenuExHook( LaunchPropertiesGUI(hModule); return FALSE; } - explorer_TrackPopupMenuExElapsed = milliseconds_now(); + if (!bIsSecondaryTaskbar) + { + explorer_TrackPopupMenuExElapsed = milliseconds_now(); + } } return b; }