CefSharp icon indicating copy to clipboard operation
CefSharp copied to clipboard

WinForms freezes when using Alt+Space on Windows 10 Anniversary

Open StBozov opened this issue 10 years ago • 8 comments

Hello all,

I use:

1 - Latest cefsharp master branch 2 - Winforms.Example (x86) 3 - Windows 10 (+ Anniversary update) - I cannot reproduce the issue on Windows 7/8/8.1 4 - Issue is not reproducible with cef simple (including Windows 10). 5 - VS 2013 (Update 4/5) and VS 2015 (Update 2/3) 6 - Issue is 100% reproducible (deterministic).

Observed behaviour is that once using Alt+Space Winforms.Example is no longer responsible. I'm able to reproduce the issue on more then 5 Windows 10 machines.

Thank you in advance for your answer.

Stefan Bozov.

StBozov avatar Oct 07 '16 11:10 StBozov

You should discuss the issue at http://magpcss.org/ceforum/viewtopic.php?f=6&t=14479

amaitland avatar Oct 07 '16 11:10 amaitland

Thanks a lot.

StBozov avatar Oct 07 '16 11:10 StBozov

This problem only appears when settings.MultiThreadedMessageLoop = true (the default). Integrating CEF into the existing message loop is possible, better integration can be obtained using #1748. This method is new and I've not tested in a production environment myself. There are reports of other CEF users implementing the method successfully. Remember that CefSharp is just a wrapper around the CEF framework. You can test the suggested workaround in the CefSharp.WinForms.Example project by changing true to false at https://github.com/cefsharp/CefSharp/blob/cefsharp/53/CefSharp.WinForms.Example/Program.cs#L62

amaitland avatar Oct 10 '16 04:10 amaitland

Thank you very much! I'll play with the master.

StBozov avatar Oct 18 '16 12:10 StBozov

I have resolved the problem changing the default value in the KeyboardHandler: var result = true; I don’t know if there are any issue, but my application seems ok.

LamboG avatar Oct 20 '16 09:10 LamboG

Proper solution/workaround was posted in the mentioned forum link - http://magpcss.org/ceforum/viewtopic.php?p=32766#p32766

chylex avatar Jan 28 '17 22:01 chylex

I'm going to close this issue as there are valid workarounds and there really isn't a way to fix this in CefSharp directly.

Option 1

Add a MenuStrip to your application, can be invisible. Originally suggested in http://magpcss.org/ceforum/viewtopic.php?p=32766#p32766

This appears to be the easiest option.

Controls.Add(new MenuStrip { Visible = false });

Option 2

Integrate CEF into the WinForms existing message loop as described above in https://github.com/cefsharp/CefSharp/issues/1822#issuecomment-252535727

amaitland avatar Jan 29 '17 23:01 amaitland

Sorry for posting in closed issue, but this still is the only real reference to the ALT -> freeze issue. Same issue happens in WPF. There is a workaround too: extend ChromiumWebBrowser class with following override: protected override void OnPreviewKeyUp(KeyEventArgs e) { if (e.Key == Key.System) { e.Handled = true; } base.OnPreviewKeyDown(e); } (inspired by this: https://stackoverflow.com/questions/54147615/how-to-mark-f10-key-as-handled-in-cefsharp-for-wpf)

SnakeBite94 avatar Apr 24 '20 11:04 SnakeBite94