From df6d7777e48c1136c745e40e745fe5e5f3513ff4 Mon Sep 17 00:00:00 2001 From: "pkasting@chromium.org" Date: Thu, 24 Sep 2009 18:04:08 +0000 Subject: Reapply the change from r8062 to fix the Windows Classic maximized window region, which I inexplicably removed in r10845. Without this fix, a maximized Chrome window on one monitor "bleeds over" into adjacent monitors in Windows Classic mode, creating a narrow strip where nothing ever redraws damaged pixels. BUG=none TEST=none Review URL: http://codereview.chromium.org/211058 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@27091 0039d316-1c4b-4281-b951-d872f2087c98 --- views/window/window_win.cc | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to 'views') diff --git a/views/window/window_win.cc b/views/window/window_win.cc index bae6fde..27ff3df 100644 --- a/views/window/window_win.cc +++ b/views/window/window_win.cc @@ -1280,10 +1280,21 @@ void WindowWin::ResetWindowRegion(bool force) { CRect window_rect; GetWindowRect(&window_rect); HRGN new_region; - gfx::Path window_mask; - non_client_view_->GetWindowMask( - gfx::Size(window_rect.Width(), window_rect.Height()), &window_mask); - new_region = window_mask.CreateHRGN(); + if (IsMaximized()) { + HMONITOR monitor = + MonitorFromWindow(GetNativeView(), MONITOR_DEFAULTTONEAREST); + MONITORINFO mi; + mi.cbSize = sizeof mi; + GetMonitorInfo(monitor, &mi); + CRect work_rect = mi.rcWork; + work_rect.OffsetRect(-window_rect.left, -window_rect.top); + new_region = CreateRectRgnIndirect(&work_rect); + } else { + gfx::Path window_mask; + non_client_view_->GetWindowMask( + gfx::Size(window_rect.Width(), window_rect.Height()), &window_mask); + new_region = window_mask.CreateHRGN(); + } if (current_rgn_result == ERROR || !EqualRgn(current_rgn, new_region)) { // SetWindowRgn takes ownership of the HRGN created by CreateHRGN. -- cgit v1.1