Windows: Fix rendering of background color and resize corner (issue #1161).

git-svn-id: https://chromiumembedded.googlecode.com/svn/branches/1547@1551 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
Marshall Greenblatt 2013-12-20 00:11:51 +00:00
parent f17fd1ca81
commit b18102df04
4 changed files with 50 additions and 2 deletions

View File

@ -505,7 +505,7 @@ LRESULT CALLBACK CefBrowserHostImpl::WndProc(HWND hwnd, UINT message,
return 0;
case WM_ERASEBKGND:
return 0;
return 1;
case WM_DWMCOMPOSITIONCHANGED:
// Message sent to top-level windows when composition has been enabled or

View File

@ -86,6 +86,12 @@ patches = [
'name': 'screen_mac',
'path': '../ui/gfx/',
},
{
# Fix rendering of background color and resize corner on Windows.
# http://code.google.com/p/chromiumembedded/issues/detail?id=1161
'name': 'web_contents_1161',
'path': '../content/browser/web_contents/',
},
{
# http://code.google.com/p/chromiumembedded/issues/detail?id=364
'name': 'spi_webcore_364',

View File

@ -0,0 +1,42 @@
Index: web_contents_view_win.cc
===================================================================
--- web_contents_view_win.cc (revision 226504)
+++ web_contents_view_win.cc (working copy)
@@ -299,6 +299,15 @@
rvh->GetDelegate()->Close(rvh);
}
+void WebContentsViewWin::OnNCPaint(HRGN update_region) {
+ // Do nothing. This suppresses the resize corner that Windows would
+ // otherwise draw for us.
+}
+
+LRESULT WebContentsViewWin::OnEraseBkgnd(HDC dc) {
+ return 1;
+}
+
LRESULT WebContentsViewWin::OnCreate(
UINT message, WPARAM wparam, LPARAM lparam, BOOL& handled) {
hwnd_to_wcv_map.insert(std::make_pair(hwnd(), this));
Index: web_contents_view_win.h
===================================================================
--- web_contents_view_win.h (revision 226504)
+++ web_contents_view_win.h (working copy)
@@ -36,6 +36,8 @@
virtual ~WebContentsViewWin();
BEGIN_MSG_MAP_EX(WebContentsViewWin)
+ MSG_WM_NCPAINT(OnNCPaint)
+ MSG_WM_ERASEBKGND(OnEraseBkgnd)
MESSAGE_HANDLER(WM_CREATE, OnCreate)
MESSAGE_HANDLER(WM_DESTROY, OnDestroy)
MESSAGE_HANDLER(WM_WINDOWPOSCHANGED, OnWindowPosChanged)
@@ -102,6 +104,8 @@
void EndDragging();
void CloseTab();
+ void OnNCPaint(HRGN update_region);
+ LRESULT OnEraseBkgnd(HDC dc);
LRESULT OnCreate(
UINT message, WPARAM wparam, LPARAM lparam, BOOL& handled);
LRESULT OnDestroy(

View File

@ -563,7 +563,7 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam,
if (hwnd) {
// Dont erase the background if the browser window has been loaded
// (this avoids flashing)
return 0;
return 1;
}
}
break;