Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
sentialx opened this issue Aug 10, 2016 · 4 comments
Labels
known-issue upstream These issues require fixing in the Chromium Embedded Framework(CEF) or Chromium. wpf WPF Implementation
Milestone

Comments

@sentialx
Copy link

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 amaitland added the wpf WPF Implementation label Aug 15, 2016
@amaitland
Copy link
Member

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 amaitland added the upstream These issues require fixing in the Chromium Embedded Framework(CEF) or Chromium. label Aug 27, 2016
@amaitland
Copy link
Member

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

amaitland added a commit to amaitland/CefSharp that referenced this issue Jan 2, 2018
…mmand based on CefMenuCommand enum rather than trying to use IRunContextMenuCallback which isn't working (upstream issue)

This is a workaround for cefsharp#1767
You can use the default CEF menu it does however require you to integrate CEF into your main message loop see cefsharp#1795
amaitland added a commit that referenced this issue Jan 18, 2018
…mmand based on CefMenuCommand enum rather than trying to use IRunContextMenuCallback which isn't working (upstream issue)

This is a workaround for #1767
You can use the default CEF menu it does however require you to integrate CEF into your main message loop see #1795
amaitland added a commit that referenced this issue Jan 22, 2018
…mmand based on CefMenuCommand enum rather than trying to use IRunContextMenuCallback which isn't working (upstream issue)

This is a workaround for #1767
You can use the default CEF menu it does however require you to integrate CEF into your main message loop see #1795
amaitland added a commit that referenced this issue Jul 9, 2018
Left over from when the built in wasn't working (it still only works partially) due to #1767
Improve comments and add links to make clearer
amaitland added a commit that referenced this issue Jul 9, 2018
Left over from when the built in wasn't working (it still only works partially) due to #1767
Improve comments and add links to make clearer
@amaitland amaitland changed the title Custom context menu issue IContextMenuHandler WPF - IContextMenuHandler callback doesn't execute when called on WPF UI thread. Sep 17, 2021
@amaitland
Copy link
Member

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 amaitland added this to the 96.0.x milestone Nov 3, 2021
@amaitland
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
known-issue upstream These issues require fixing in the Chromium Embedded Framework(CEF) or Chromium. wpf WPF Implementation
Projects
None yet
Development

No branches or pull requests

2 participants