salvadordf / CEF4Delphi

CEF4Delphi is an open source project to embed Chromium-based browsers in applications made with Delphi or Lazarus/FPC for Windows, Linux and MacOS.
https://www.briskbard.com/forum/
Other
1.19k stars 363 forks source link

SubMenu appears at incorrect position #501

Open pmccarenko opened 5 months ago

pmccarenko commented 5 months ago

Hi!

After adding SubMenu to standard menu, this menu appears at correct position only first time. But next time it always appears in the upper left corner of the screen. Please see the video below.

https://drive.google.com/file/d/1um1ygXjDvglYS9nvoTtEHAfSkI4MISzk/view?usp=drive_link

To Repeat this issue - add code to SimpleOSRBrowser project in Lazarus (on Video it Lazarus 3.1 with CEF4Delphi 121.3.2, but it present in any version of CEF4Delphi above 107.1.12; In Version 107.1.12 all works Ok):

procedure TForm1.chrmosrBeforeContextMenu(Sender: TObject; const browser: ICefBrowser; const frame: ICefFrame; const params: ICefContextMenuParams; const model: ICefMenuModel); const MY_CONTEXTMENU_ASUBMENU = MENU_ID_USER_FIRST + 100; MY_CONTEXTMENU_ASUBMENU_ITEM1 = MENU_ID_USER_FIRST + 200; MY_CONTEXTMENU_ASUBMENU_ITEM2 = MENU_ID_USER_FIRST + 300; var aSubMenu: ICefMenuModel; begin aSubMenu:=model.AddSubMenu(MY_CONTEXTMENU_ASUBMENU,'Test Menu'); aSubMenu.AddItem(MY_CONTEXTMENU_ASUBMENU_ITEM1,'SubMenu 1'); aSubMenu.AddItem(MY_CONTEXTMENU_ASUBMENU_ITEM2,'SubMenu 2'); end;

salvadordf commented 5 months ago

I can reproduce this issue with the official CEF sample application so I reported it to the CEF project. https://github.com/chromiumembedded/cef/issues/3640