Closed Dragmoria closed 2 years ago
Please test with the 96-pre release. See https://github.com/cefsharp/CefSharp/issues/3902#issuecomment-978820002
A custom WPF specific context menu is now used instead of the default CEF native menu (#1767)
I just tried this in my own project and if I remove the web browser menu handler it works now which is awesome, if I don't do that it still does goes to the wrong position. I do wonder how I would go about adding extra items or removing certain items from the context menu if that is at all possible still since using this with a menu handler doesn't work?
I do wonder how I would go about adding extra items or removing certain items from the context menu if that is at all possible still since using this with a menu handler doesn't work?
You can extend the WPF
implementation, see https://github.com/cefsharp/CefSharp/blob/cefsharp/96/CefSharp.Wpf.Example/Handlers/MenuHandler.cs for example of adding a new command, you can customise the existing model as you would normally.
Awesome that all works. Ty very much.
Bug Report
What version of the product are you using?
What architecture x86 or x64? Problem occurs on bot x86 and x64
What version of .Net? Problem occurs in MinimalExample.wpf which seems to use .NET 4.5.2. The issue also occurs when I run my own project which is .NET 5.0
On what operating system? Windows 10 Pro
Are you using
WinForms
,WPF
orOffScreen
? WPFWhat steps will reproduce the problem? I wanted to add a panel to the left of the browser with a treeview and this panel had to be resizable. When I did so i noticed that whenever I right clicked on the browser the context menu shows at the position of the click. But once I resize the grid with a gridsplitter and right click on the browser the context menu does not show at the position of the click.
To see if this was an issue with my own project I tried adding a gridsplitter to the MinimalExample.WPF project and the same occured here. I have tried to implement Run Cef.DoMessageLoopWork manually in WPF app from amaitland to see if this may help but it didn't affect this issue.
To reproduce this issue I added a simple gridsplitter to the already existing MainWindow.xaml in the MinimalExample.WPF project.
What is the expected output? What do you see instead? The expected behaviour would be that the context menu would show at the position of the mouseclick but this is not the case. The following two images show the actual output.
Without Resize:![image](https://user-images.githubusercontent.com/57449002/143574126-c76c7221-edc8-4e0f-8910-fe10e2a8f810.png)
With resize:![image](https://user-images.githubusercontent.com/57449002/143574141-041e66dd-ac6c-4e94-b2a7-2d83316f2f9d.png)
In both cases I clicked on the center of the G. Without a resize it works well but after a resize the position doesn't match.
Please provide any additional information below. I have none.
Does this problem also occur in the
CEF
Sample Application If MinimalExample.WPF is also a Sample Application then yes. I'm unable to run any of the examples from https://github.com/cefsharp/CefSharp.