Skip to content

Commit

Permalink
minor fix for popup placement
Browse files Browse the repository at this point in the history
  • Loading branch information
dk committed Dec 11, 2024
1 parent d39efe2 commit d5f153c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions unix/menu.c
Original file line number Diff line number Diff line change
Expand Up @@ -2514,10 +2514,10 @@ apc_popup( Handle self, int x, int y, Rect *anchor)
y = anchor-> top - w-> sz. y;
else
y = 0;
if ( anchor-> right + w-> sz.x <= guts. displaySize.x)
x = anchor-> right;
else if ( w-> sz.x < anchor-> left)
x = anchor-> left - w-> sz. x;
if ( anchor-> left + w-> sz.x <= guts. displaySize.x)
x = anchor-> left;
else if ( w-> sz.x < anchor-> right)
x = anchor-> right - w-> sz. x;
else
x = 0;
w-> pos. x = x;
Expand Down
2 changes: 1 addition & 1 deletion win32/menu.c
Original file line number Diff line number Diff line change
Expand Up @@ -665,7 +665,7 @@ apc_popup( Handle self, int x, int y, Rect * anchor)

guts. popup_active = 1;
ret = TrackPopupMenuEx(
( HMENU) var handle, TPM_LEFTBUTTON|TPM_LEFTALIGN|TPM_RIGHTBUTTON,
( HMENU) var handle, TPM_LEFTBUTTON|TPM_LEFTALIGN|TPM_TOPALIGN|TPM_RIGHTBUTTON,
x, y, owner, anchor ? &tpm : NULL);
guts. popup_active = 0;
return ret;
Expand Down

0 comments on commit d5f153c

Please sign in to comment.