alloy: win: Focus the browser after dismissal of a modal dialog (fixes issue #3361)

This commit is contained in:
Marshall Greenblatt 2022-07-15 14:04:21 +03:00
parent dac76df7e3
commit 418ae98476
2 changed files with 18 additions and 0 deletions

View File

@ -677,6 +677,15 @@ LRESULT CALLBACK CefBrowserPlatformDelegateNativeWin::WndProc(HWND hwnd,
rect->bottom - rect->top, SWP_NOZORDER | SWP_NOACTIVATE);
}
break;
case WM_ENABLE:
if (wParam == TRUE && browser) {
// Give focus to the browser after EnableWindow enables this window
// (e.g. after a modal dialog is dismissed).
browser->SetFocus(true);
return 0;
}
break;
}
return DefWindowProc(hwnd, message, wParam, lParam);

View File

@ -539,6 +539,15 @@ LRESULT CALLBACK RootWindowWin::RootWndProc(HWND hWnd,
self->OnFocus();
return 0;
case WM_ENABLE:
if (wParam == TRUE) {
// Give focus to the browser after EnableWindow enables this window
// (e.g. after a modal dialog is dismissed).
self->OnFocus();
return 0;
}
break;
case WM_SIZE:
self->OnSize(wParam == SIZE_MINIMIZED);
break;