Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(48)

Unified Diff: views/window/window_win.cc

Issue 211058: Reapply the change from r8062 to fix the Windows Classic maximized window reg... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: views/window/window_win.cc
===================================================================
--- views/window/window_win.cc (revision 26827)
+++ views/window/window_win.cc (working copy)
@@ -1280,10 +1280,21 @@
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.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698