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

Side by Side Diff: chrome/views/non_client_view.cc

Issue 43052: Fix black titlebar rendering when toggling DWM when the window is maximized:... (Closed) Base URL: svn://chrome-svn.corp.google.com/chrome/trunk/src/
Patch Set: '' Created 11 years, 9 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
« no previous file with comments | « no previous file | chrome/views/widget_win.h » ('j') | 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 "chrome/views/non_client_view.h" 5 #include "chrome/views/non_client_view.h"
6 6
7 #include "chrome/common/win_util.h" 7 #include "chrome/common/win_util.h"
8 #include "chrome/views/root_view.h" 8 #include "chrome/views/root_view.h"
9 #include "chrome/views/window.h" 9 #include "chrome/views/window.h"
10 10
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 // behind the entire client area. This is because for some reason the 59 // behind the entire client area. This is because for some reason the
60 // SkPorterDuff::kClear_mode erase done in the RootView thinks the window is 60 // SkPorterDuff::kClear_mode erase done in the RootView thinks the window is
61 // still opaque. So, to work around this we hide the window as soon as we can 61 // still opaque. So, to work around this we hide the window as soon as we can
62 // (now), saving off its placement so it can be properly restored once 62 // (now), saving off its placement so it can be properly restored once
63 // everything has settled down. 63 // everything has settled down.
64 WINDOWPLACEMENT saved_window_placement; 64 WINDOWPLACEMENT saved_window_placement;
65 saved_window_placement.length = sizeof(WINDOWPLACEMENT); 65 saved_window_placement.length = sizeof(WINDOWPLACEMENT);
66 GetWindowPlacement(frame_->GetHWND(), &saved_window_placement); 66 GetWindowPlacement(frame_->GetHWND(), &saved_window_placement);
67 frame_->Hide(); 67 frame_->Hide();
68 68
69 // Important (and ugly) step: restore the window first, since our hiding hack
70 // doesn't work for maximized windows! We tell the frame not to allow itself
71 // to be made visible though, which removes the brief flicker.
72 frame_->set_force_hidden(true);
73 ShowWindow(frame_->GetHWND(), SW_RESTORE);
74 frame_->set_force_hidden(false);
75
69 SetUseNativeFrame(win_util::ShouldUseVistaFrame()); 76 SetUseNativeFrame(win_util::ShouldUseVistaFrame());
70 77
71 // Now that we've updated the frame, we'll want to restore our saved placement 78 // Now that we've updated the frame, we'll want to restore our saved placement
72 // since the display should have settled down and we can be properly rendered. 79 // since the display should have settled down and we can be properly rendered.
73 SetWindowPlacement(frame_->GetHWND(), &saved_window_placement); 80 SetWindowPlacement(frame_->GetHWND(), &saved_window_placement);
74 } 81 }
75 82
76 void NonClientView::SetUseNativeFrame(bool use_native_frame) { 83 void NonClientView::SetUseNativeFrame(bool use_native_frame) {
77 use_native_frame_ = use_native_frame; 84 use_native_frame_ = use_native_frame;
78 SetFrameView(frame_->CreateFrameViewForWindow()); 85 SetFrameView(frame_->CreateFrameViewForWindow());
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
235 } else { 242 } else {
236 return HTNOWHERE; 243 return HTNOWHERE;
237 } 244 }
238 245
239 // If the window can't be resized, there are no resize boundaries, just 246 // If the window can't be resized, there are no resize boundaries, just
240 // window borders. 247 // window borders.
241 return can_resize ? component : HTBORDER; 248 return can_resize ? component : HTBORDER;
242 } 249 }
243 250
244 } // namespace views 251 } // namespace views
OLDNEW
« no previous file with comments | « no previous file | chrome/views/widget_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698