@@ -345,7 +345,8 @@ bool CMenuContainer::s_bMRULoaded=false;
345345const CItemManager::ItemInfo *CMenuContainer::s_JumpAppInfo;
346346CJumpList CMenuContainer::s_JumpList;
347347int CMenuContainer::s_TaskBarId;
348- HWND CMenuContainer::s_TaskBar, CMenuContainer::s_StartButton;
348+ HWND CMenuContainer::s_TaskBar;
349+ HWND CMenuContainer::s_StartButton; // custom start button (if any)
349350UINT CMenuContainer::s_TaskBarEdge;
350351RECT CMenuContainer::s_StartRect;
351352HWND CMenuContainer::s_LastFGWindow;
@@ -1588,6 +1589,23 @@ static const wchar_t *g_MfuIgnoreExes[]={
15881589 L" WUAPP.EXE" ,
15891590};
15901591
1592+ static bool IgnoreUserAssistItem (const UserAssistItem& uaItem)
1593+ {
1594+ static constexpr const wchar_t * ignoredNames[] =
1595+ {
1596+ DESKTOP_APP_ID,
1597+ L" Microsoft.Windows.ShellExperienceHost_cw5n1h2txyewy!App" ,
1598+ };
1599+
1600+ for (const auto & name : ignoredNames)
1601+ {
1602+ if (_wcsicmp (uaItem.name , name) == 0 )
1603+ return true ;
1604+ }
1605+
1606+ return false ;
1607+ }
1608+
15911609void CMenuContainer::GetRecentPrograms ( std::vector<MenuItem> &items, int maxCount )
15921610{
15931611 bool bShowMetro=GetSettingBool (L" RecentMetroApps" );
@@ -1940,9 +1958,9 @@ void CMenuContainer::GetRecentPrograms( std::vector<MenuItem> &items, int maxCou
19401958 continue ;
19411959 }
19421960
1943- if (_wcsicmp (uaItem. name ,DESKTOP_APP_ID)== 0 )
1961+ if (IgnoreUserAssistItem (uaItem) )
19441962 {
1945- LOG_MENU (LOG_MFU,L" UserAssist: Dropping: Ignore desktop " );
1963+ LOG_MENU (LOG_MFU,L" UserAssist: Dropping: Ignore '%s' " ,uaItem. name );
19461964 continue ;
19471965 }
19481966
@@ -7507,17 +7525,32 @@ RECT CMenuContainer::CalculateWorkArea( const RECT &taskbarRect )
75077525 return rc;
75087526}
75097527
7528+ // Calculates start menu position
75107529POINT CMenuContainer::CalculateCorner ( void )
75117530{
75127531 RECT margin={0 ,0 ,0 ,0 };
75137532 if (IsAppThemed ())
75147533 AdjustWindowRect (&margin,GetWindowLong (GWL_STYLE),FALSE );
75157534
75167535 POINT corner;
7517- if (m_Options&CONTAINER_LEFT)
7518- corner.x =s_MainMenuLimits.left +margin.left ;
7536+ if (IsWin11 ())
7537+ {
7538+ // start button can be in the center on Win11
7539+ // we want to show menu at the position of start button
7540+ if (m_Options&CONTAINER_LEFT)
7541+ corner.x =s_StartRect.left +margin.left ;
7542+ else
7543+ corner.x =s_StartRect.right +margin.right ;
7544+ }
75197545 else
7520- corner.x =s_MainMenuLimits.right +margin.right ;
7546+ {
7547+ // start button can be only in corner on older systems
7548+ // we can use screen limits to determine menu position
7549+ if (m_Options&CONTAINER_LEFT)
7550+ corner.x =s_MainMenuLimits.left +margin.left ;
7551+ else
7552+ corner.x =s_MainMenuLimits.right +margin.right ;
7553+ }
75217554
75227555 if (m_Options&CONTAINER_TOP)
75237556 {
@@ -7636,6 +7669,9 @@ HWND CMenuContainer::ToggleStartMenu( int taskbarId, bool bKeyboard, bool bAllPr
76367669 // initialize all settings
76377670 bool bErr=false ;
76387671 HMONITOR initialMonitor=MonitorFromWindow (s_TaskBar,MONITOR_DEFAULTTONEAREST);
7672+ // note: GetTaskbarPosition properly identifies monitor in case of multi-monitor setup and automatic taskbar hiding
7673+ GetTaskbarPosition (s_TaskBar,NULL ,&initialMonitor,NULL );
7674+
76397675 int dpi=CItemManager::GetDPI (true );
76407676 if (!CItemManager::GetDPIOverride () && GetWinVersion ()>=WIN_VER_WIN81)
76417677 {
0 commit comments