mirror of
https://github.com/cefsharp/CefSharp.git
synced 2026-12-04 10:22:55 +00:00
Fixed a bug which has been bothering me a bit in the CEF1-based branch: Alt-F4 shouldn't be marked as Handled, since that makes it impossible to shut down the app by pressing Alt-F4...
This commit is contained in:
@@ -272,6 +272,14 @@ namespace CefSharp.Wpf
|
||||
break;
|
||||
}
|
||||
|
||||
if (message == (int) WM.SYSKEYDOWN &&
|
||||
wParam.ToInt32() == KeyInterop.VirtualKeyFromKey(Key.F4))
|
||||
{
|
||||
// We don't want CEF to receive this event (and mark it as handled), since that makes it impossible to
|
||||
// shut down a CefSharp-based app by pressing Alt-F4, which is kind of bad.
|
||||
return IntPtr.Zero;
|
||||
}
|
||||
|
||||
if (cefBrowserWrapper.SendKeyEvent(message, wParam.ToInt32()))
|
||||
{
|
||||
handled = true;
|
||||
|
||||
Reference in New Issue
Block a user