Closed
Description
I wasn't able to find anything about this issue, so here it goes.
- What version of the product are you using?
- From branch v51.0.0
- What architecture x86 or x64?
- 86
- On what operating system?
- Win7
- Are you using
WinForms
,WPF
orOffScreen
?- WPF
- What steps will reproduce the problem?
- Open any page and right-click once. the context menu appears. Then left-click anywhere on the page besides the context menu.
- What is the expected output? What do you see instead?
- Expected: context menu dissapears
- Instead: context menu won't disapear until I click in one of its options. It stays on the screen even when I alt tab to another application like Outlook, explorer, IE, etc...
- Please provide any additional information below.
- I'm using the "disable-gpu" command line.
- I'm running a very simple WPF application that only contains the browser without any custom events, buttons, navigations... Just the browser itself.
Metadata
Metadata
Assignees
Labels
Type
Projects
Milestone
Relationships
Development
No branches or pull requests
Activity
[-]WPF bug - context menu doesn't disapears after left-click[/-][+]Context menu doesn't disapears after left-click[/+]amaitland commentedon Sep 7, 2016
To my knowledge this is the first version of
CEF
that has a context menu for theOSR
rendering implementation (WPF
usesOSR
). Typically I'd suggest implementing a custom menu, unfortunately that's also a problem in51.0.0
see #1767If you take a look at https://github.com/cefsharp/CefSharp/blob/master/CONTRIBUTING.md#cefsharp-vs-chromium-embedded-frameworkcef you can isolate the problem, determine if it's a problem with the
CefSharp
implementation or a bug inCEF
.I'd suggest hosting the
WinForms
version inWPF
, pretty common approach.sparcopt commentedon Sep 7, 2016
Thanks @amaitland , I will give it a try.
For the moment I will stick to your suggestion and host the
WinForms
version inWPF
.amaitland commentedon Sep 8, 2016
Using #1748 seems to resolve the problem. So it's just a disconnect between running the message loop in a different thread it appears (Fairly common problem).
amaitland commentedon Jan 10, 2017
Using a custom menu (which is blocked on #1767) or integrate into your apps existing message loop are the two options for resolving this.
WPF Example - update MenuHandler to implement custom menu, execute co…
WPF Example - update MenuHandler to implement custom menu, execute co…
WPF Example - update MenuHandler to implement custom menu, execute co…
amaitland commentedon Oct 22, 2019
The project source contains an example of a custom
IContextMenuHandler
See https://github.com/cefsharp/CefSharp/blob/cefsharp/75/CefSharp.Wpf.Example/Handlers/MenuHandler.cs