- Fix initial state of the |is_showing_| flag in CefRenderWidgetHostViewOSR (issue #1363).

- Windows: Modify the cefclient OSR example to call WasHidden(true) when the app is minimized.

git-svn-id: https://chromiumembedded.googlecode.com/svn/branches/2062@1819 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
Marshall Greenblatt
2014-09-04 22:15:45 +00:00
parent f693c4a6d2
commit 45d9e3f357
5 changed files with 46 additions and 12 deletions

View File

@ -597,15 +597,26 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam,
return 0;
case WM_SIZE:
// Minimizing resizes the window to 0x0 which causes our layout to go all
// screwy, so we just ignore it.
if (wParam != SIZE_MINIMIZED && g_handler.get() &&
g_handler->GetBrowser()) {
if (!g_handler.get())
break;
// Mark the off-screen browser as hidden when the frame window is
// minimized to reduce resource usage.
if (AppIsOffScreenRenderingEnabled()) {
CefRefPtr<OSRWindow> osr_window =
static_cast<OSRWindow*>(g_handler->GetOSRHandler().get());
if (osr_window)
osr_window->WasHidden(wParam == SIZE_MINIMIZED);
}
// Don't resize the window if minimizing because the resulting size of 0x0
// causes the layout to go all screwy.
if (wParam != SIZE_MINIMIZED && g_handler->GetBrowser()) {
// Retrieve the window handle (parent window with off-screen rendering).
CefWindowHandle hwnd =
g_handler->GetBrowser()->GetHost()->GetWindowHandle();
if (hwnd) {
// Resize the browser window and address bar to match the new frame
// window size
// Resize the window and address bar to match the new frame size.
RECT rect;
GetClientRect(hWnd, &rect);
rect.top += URLBAR_HEIGHT;