[NTUSER] Fix popup menu placement when part way off right edge of screen (#7220)

* Move the popup menu to the right edge of the screen when it is past the screen edge on the right.

CORE-19706
This commit is contained in:
Doug Lyons 2024-08-10 16:00:44 -05:00 committed by GitHub
parent e546525eac
commit 9ee30c57fd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -2992,16 +2992,14 @@ static BOOL FASTCALL MENU_ShowPopup(PWND pwndOwner, PMENU menu, UINT id, UINT fl
/* We are off the right side of the screen */
if (x + width > monitor->rcMonitor.right)
{
if ((x - width) < monitor->rcMonitor.left || x >= monitor->rcMonitor.right)
/* Position menu at right edge of the screen */
x = monitor->rcMonitor.right - width;
else
x -= width;
}
/* We are off the left side of the screen */
if (x < monitor->rcMonitor.left)
{
/* Position menu at left edge of screen */
/* Position menu at left edge of the screen */
x = 0;
if (x < monitor->rcMonitor.left || x >= monitor->rcMonitor.right || bIsPopup)