cefsharp / CefSharp

.NET (WPF and Windows Forms) bindings for the Chromium Embedded Framework
http://cefsharp.github.io/
Other
9.79k stars 2.92k forks source link

WPF - IContextMenuHandler callback doesn't execute when called on `WPF UI` thread. #1767

Closed sentialx closed 2 years ago

sentialx commented 8 years ago

Hi, I'm using Cefsharp 51 x86 on Windows 10 and I have problem with IContextMenuHandler. I created my custom context menu using this code: https://github.com/cefsharp/CefSharp/blob/e3c0d8b013d85dc41d4e01a573dd50506943fc7e/CefSharp.Wpf.Example/Handlers/MenuHandler.cs

if (commandId == (CefMenuCommand)26501)
            {
                browser.GetHost().ShowDevTools();
                return true;
            }
            if (commandId == (CefMenuCommand)26502)
            {
                browser.GetHost().CloseDevTools();
                return true;
            }

theese conditions are not firing when I click on the context menu item 26501 or 26502. I tried to add Console.WriteLine("something"); but still does not work. Before update to CefSharp 51 context menu was working fine

amaitland commented 8 years ago

Have you verified the problem exists when running using the CefSharp.Wpf.Example? If there is a problem, it's likely a bug in CEF.

amaitland commented 7 years ago

From what I can tell this is a bug in CEF and should be reported on http://magpcss.org/ceforum/index.php

amaitland commented 2 years ago

It's unlikely the upstream issue will be resolved so PR #3815 will added a native WPF menu that can be used and extended.

amaitland commented 2 years ago

Starting in version 96 we'll use our custom WPF menu by default.