-
-
Notifications
You must be signed in to change notification settings - Fork 581
Open
Description
There are changes in cefclient in regards to WM_RESIZE event. When window is minimized browser size is set to 0x0 to reduce resource usage. See example code from cefclient:
LRESULT CALLBACK RootWindowWin::RootWndProc(HWND hWnd, UINT message,
WPARAM wParam, LPARAM lParam) {
...
case WM_SIZE:
self->OnSize(wParam == SIZE_MINIMIZED);
break;
...
}
void RootWindowWin::OnSize(bool minimized) {
if (minimized) {
// Notify the browser window that it was hidden and do nothing further.
if (browser_window_)
browser_window_->Hide();
return;
}
if (browser_window_)
browser_window_->Show();
...
}
void BrowserWindowStdWin::Show() {
REQUIRE_MAIN_THREAD();
HWND hwnd = GetWindowHandle();
if (hwnd && !::IsWindowVisible(hwnd))
ShowWindow(hwnd, SW_SHOW);
}
void BrowserWindowStdWin::Hide() {
REQUIRE_MAIN_THREAD();
HWND hwnd = GetWindowHandle();
if (hwnd) {
// When the frame window is minimized set the browser window size to 0x0 to
// reduce resource usage.
SetWindowPos(hwnd, NULL,
0, 0, 0, 0, SWP_NOZORDER | SWP_NOMOVE | SWP_NOACTIVATE);
}
}