IDE: Improve popup menu position in designer when using keyboard. Issue #40807, patch by n7800.

This commit is contained in:
Juha 2024-06-11 13:37:57 +03:00
parent 473cc20292
commit 560115beea

View File

@ -2040,7 +2040,13 @@ begin
begin
PopupMenuComponentEditor := GetComponentEditorForSelection;
BuildPopupMenu;
FDesignerPopupMenu.Popup(Message.XPos, Message.YPos);
if (Message.XPos = -1) and (Message.YPos = -1) then
// called from keyboard (VK_APPS or Shift+F10)
with Form.ClientToScreen(Point(Selection.Left, Selection.Top)) do
FDesignerPopupMenu.Popup(X, Y)
else
// coordinates can be negative with multiple monitors
FDesignerPopupMenu.Popup(Message.XPos, Message.YPos);
end;
Message.Result := 1;
end;