Windows: Fix focus assignment after dismissing JS dialogs (issue #2584)

This commit is contained in:
Marshall Greenblatt
2019-02-11 17:22:42 -05:00
parent b8eaec0db2
commit f85816f0c7
4 changed files with 24 additions and 13 deletions

View File

@ -707,7 +707,10 @@ LRESULT CALLBACK CefBrowserPlatformDelegateNativeWin::WndProc(HWND hwnd,
return 0;
case WM_SETFOCUS:
if (browser)
// Selecting "Close window" from the task bar menu may send a focus
// notification even though the window is currently disabled (e.g. while
// a modal JS dialog is displayed).
if (browser && ::IsWindowEnabled(hwnd))
browser->SetFocus(true);
return 0;