From 71773b5bbc3c5e6fa977d629827f7640c32cc8d5 Mon Sep 17 00:00:00 2001 From: Marshall Greenblatt Date: Tue, 29 May 2012 17:39:39 +0000 Subject: [PATCH] Windows: Avoid resizing the child window to 0x0 when the parent window is minimized (issue #606). git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@653 5089003a-bbd8-11dd-ad1f-f1f9622dbc98 --- libcef/browser/browser_host_impl_win.cc | 4 +++- tests/cefclient/cefclient_win.cpp | 5 ++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/libcef/browser/browser_host_impl_win.cc b/libcef/browser/browser_host_impl_win.cc index 4b5de7f0d..bfd8f5a88 100644 --- a/libcef/browser/browser_host_impl_win.cc +++ b/libcef/browser/browser_host_impl_win.cc @@ -118,7 +118,9 @@ LRESULT CALLBACK CefBrowserHostImpl::WndProc(HWND hwnd, UINT message, return 0; case WM_SIZE: - if (browser) { + // Minimizing resizes the window to 0x0 which causes our layout to go all + // screwy, so we just ignore it. + if (wParam != SIZE_MINIMIZED && browser) { // resize the web view window to the full size of the browser window RECT rc; GetClientRect(hwnd, &rc); diff --git a/tests/cefclient/cefclient_win.cpp b/tests/cefclient/cefclient_win.cpp index e4aabfeca..a1dd1aec0 100644 --- a/tests/cefclient/cefclient_win.cpp +++ b/tests/cefclient/cefclient_win.cpp @@ -442,7 +442,10 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, return 0; case WM_SIZE: - if (g_handler.get() && g_handler->GetBrowser()) { + // 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()) { CefWindowHandle hwnd = g_handler->GetBrowser()->GetHost()->GetWindowHandle(); if (hwnd) {