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

Unified Diff: chrome/views/custom_frame_window.cc

Issue 18258: Fix maximized mode drawing offscreen in Classic mode. Apparently Classic, un... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 11 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: chrome/views/custom_frame_window.cc
===================================================================
--- chrome/views/custom_frame_window.cc (revision 7868)
+++ chrome/views/custom_frame_window.cc (working copy)
@@ -1319,10 +1319,18 @@
HRGN current_rgn = CreateRectRgn(0, 0, 0, 0);
int current_rgn_result = GetWindowRgn(GetHWND(), current_rgn);
- HRGN new_region = NULL;
- if (!IsMaximized()) {
- CRect window_rect;
- GetWindowRect(&window_rect);
+ CRect window_rect;
+ GetWindowRect(&window_rect);
+ HRGN new_region;
+ if (IsMaximized()) {
+ HMONITOR monitor = MonitorFromWindow(GetHWND(), 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()),
@@ -1330,11 +1338,10 @@
new_region = window_mask.CreateHRGN();
}
- if (current_rgn_result == ERROR ||
- !EqualRgn(current_rgn, new_region)) {
+ if (current_rgn_result == ERROR || !EqualRgn(current_rgn, new_region)) {
// SetWindowRgn takes ownership of the HRGN created by CreateHRGN.
SetWindowRgn(new_region, TRUE);
- } else if (new_region) {
+ } else {
DeleteObject(new_region);
}
« 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