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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "views/window/window_win.h" 5 #include "views/window/window_win.h"
6 6
7 #include <dwmapi.h> 7 #include <dwmapi.h>
8 #include <shellapi.h> 8 #include <shellapi.h>
9 9
10 #include "app/gfx/canvas_paint.h" 10 #include "app/gfx/canvas_paint.h"
(...skipping 1262 matching lines...) Expand 10 before | Expand all | Expand 10 after
1273 } 1273 }
1274 1274
1275 // Changing the window region is going to force a paint. Only change the 1275 // Changing the window region is going to force a paint. Only change the
1276 // window region if the region really differs. 1276 // window region if the region really differs.
1277 HRGN current_rgn = CreateRectRgn(0, 0, 0, 0); 1277 HRGN current_rgn = CreateRectRgn(0, 0, 0, 0);
1278 int current_rgn_result = GetWindowRgn(GetNativeView(), current_rgn); 1278 int current_rgn_result = GetWindowRgn(GetNativeView(), current_rgn);
1279 1279
1280 CRect window_rect; 1280 CRect window_rect;
1281 GetWindowRect(&window_rect); 1281 GetWindowRect(&window_rect);
1282 HRGN new_region; 1282 HRGN new_region;
1283 gfx::Path window_mask; 1283 if (IsMaximized()) {
1284 non_client_view_->GetWindowMask( 1284 HMONITOR monitor =
1285 gfx::Size(window_rect.Width(), window_rect.Height()), &window_mask); 1285 MonitorFromWindow(GetNativeView(), MONITOR_DEFAULTTONEAREST);
1286 new_region = window_mask.CreateHRGN(); 1286 MONITORINFO mi;
1287 mi.cbSize = sizeof mi;
1288 GetMonitorInfo(monitor, &mi);
1289 CRect work_rect = mi.rcWork;
1290 work_rect.OffsetRect(-window_rect.left, -window_rect.top);
1291 new_region = CreateRectRgnIndirect(&work_rect);
1292 } else {
1293 gfx::Path window_mask;
1294 non_client_view_->GetWindowMask(
1295 gfx::Size(window_rect.Width(), window_rect.Height()), &window_mask);
1296 new_region = window_mask.CreateHRGN();
1297 }
1287 1298
1288 if (current_rgn_result == ERROR || !EqualRgn(current_rgn, new_region)) { 1299 if (current_rgn_result == ERROR || !EqualRgn(current_rgn, new_region)) {
1289 // SetWindowRgn takes ownership of the HRGN created by CreateHRGN. 1300 // SetWindowRgn takes ownership of the HRGN created by CreateHRGN.
1290 SetWindowRgn(new_region, TRUE); 1301 SetWindowRgn(new_region, TRUE);
1291 } else { 1302 } else {
1292 DeleteObject(new_region); 1303 DeleteObject(new_region);
1293 } 1304 }
1294 1305
1295 DeleteObject(current_rgn); 1306 DeleteObject(current_rgn);
1296 } 1307 }
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
1362 Window::CloseSecondaryWidget(root_view->GetWidget()); 1373 Window::CloseSecondaryWidget(root_view->GetWidget());
1363 return TRUE; 1374 return TRUE;
1364 } 1375 }
1365 } // namespace 1376 } // namespace
1366 1377
1367 void Window::CloseAllSecondaryWindows() { 1378 void Window::CloseAllSecondaryWindows() {
1368 EnumThreadWindows(GetCurrentThreadId(), WindowCallbackProc, 0); 1379 EnumThreadWindows(GetCurrentThreadId(), WindowCallbackProc, 0);
1369 } 1380 }
1370 1381
1371 } // namespace views 1382 } // namespace views
OLDNEW
« 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