mirror of
https://github.com/reactos/reactos.git
synced 2025-02-22 16:36:33 +00:00
[0.4.11] [WIN32K:NTUSER] Fix a case where the menu was off-screen on the other side
Found by Denis Malikov CORE-15001 CORE-9037 This is an addendum to 0.4.11-RC-27-g007ec0310c
The issue fixed here can be reproduced by not selecting anything on desktop and then pressing the context-menu-key on keyboard (next to right string) Expected behavior: popup menu should open up at coordinate 0,0 Top-left of the screen. cherry picked from commit 0.4.12-dev-369-g007ec0310c
This commit is contained in:
parent
97ab52a4ce
commit
83e4a612e3
1 changed files with 6 additions and 4 deletions
|
@ -2904,8 +2904,9 @@ static BOOL FASTCALL MENU_ShowPopup(PWND pwndOwner, PMENU menu, UINT id, UINT fl
|
|||
|
||||
if( x + width > monitor->rcMonitor.right)
|
||||
{
|
||||
/* If we would flip around our origin, would we go off screen on the other side? */
|
||||
if (x - width < monitor->rcMonitor.left)
|
||||
/* If we would flip around our origin, would we go off screen on the other side?
|
||||
Or is our origin itself too far to the right already? */
|
||||
if (x - width < monitor->rcMonitor.left || x > monitor->rcMonitor.right)
|
||||
x = monitor->rcMonitor.right - width;
|
||||
else
|
||||
x -= width;
|
||||
|
@ -2927,8 +2928,9 @@ static BOOL FASTCALL MENU_ShowPopup(PWND pwndOwner, PMENU menu, UINT id, UINT fl
|
|||
|
||||
if( y + height > monitor->rcMonitor.bottom)
|
||||
{
|
||||
/* If we would flip around our origin, would we go off screen on the other side? */
|
||||
if (y - height < monitor->rcMonitor.top)
|
||||
/* If we would flip around our origin, would we go off screen on the other side?
|
||||
Or is our origin itself too far to the bottom already? */
|
||||
if (y - height < monitor->rcMonitor.top || y > monitor->rcMonitor.bottom)
|
||||
y = monitor->rcMonitor.bottom - height;
|
||||
else
|
||||
y -= height;
|
||||
|
|
Loading…
Reference in a new issue