mirror of
https://github.com/Open-Shell/Open-Shell-Menu.git
synced 2026-06-14 03:16:38 +10:00
Proper start menu alignment in case of vertical taskbar Windows 11
Fixes #1231
This commit is contained in:
@@ -7533,31 +7533,17 @@ POINT CMenuContainer::CalculateCorner( void )
|
|||||||
AdjustWindowRect(&margin,GetWindowLong(GWL_STYLE),FALSE);
|
AdjustWindowRect(&margin,GetWindowLong(GWL_STYLE),FALSE);
|
||||||
|
|
||||||
POINT corner;
|
POINT corner;
|
||||||
if (IsWin11())
|
if (m_Options&CONTAINER_LEFT)
|
||||||
{
|
corner.x=max(s_MainMenuLimits.left,s_StartRect.left)+margin.left;
|
||||||
// start button can be in the center on Win11
|
|
||||||
// we want to show menu at the position of start button
|
|
||||||
if (m_Options&CONTAINER_LEFT)
|
|
||||||
corner.x=s_StartRect.left+margin.left;
|
|
||||||
else
|
|
||||||
corner.x=s_StartRect.right+margin.right;
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
corner.x=min(s_MainMenuLimits.right,s_StartRect.right)+margin.right;
|
||||||
// start button can be only in corner on older systems
|
|
||||||
// we can use screen limits to determine menu position
|
|
||||||
if (m_Options&CONTAINER_LEFT)
|
|
||||||
corner.x=s_MainMenuLimits.left+margin.left;
|
|
||||||
else
|
|
||||||
corner.x=s_MainMenuLimits.right+margin.right;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (m_Options&CONTAINER_TOP)
|
if (m_Options&CONTAINER_TOP)
|
||||||
{
|
{
|
||||||
if (s_bBehindTaskbar)
|
if (s_bBehindTaskbar)
|
||||||
corner.y=s_MainMenuLimits.top+margin.top;
|
corner.y=max(s_MainMenuLimits.top,s_StartRect.top)+margin.top;
|
||||||
else
|
else
|
||||||
corner.y=s_MainMenuLimits.top;
|
corner.y=max(s_MainMenuLimits.top,s_StartRect.top);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
corner.y=s_MainMenuLimits.bottom+margin.bottom;
|
corner.y=s_MainMenuLimits.bottom+margin.bottom;
|
||||||
|
|||||||
Reference in New Issue
Block a user