Chromium Code Reviews| Index: chrome/browser/ui/views/frame/browser_desktop_window_tree_host_win.cc |
| diff --git a/chrome/browser/ui/views/frame/browser_desktop_window_tree_host_win.cc b/chrome/browser/ui/views/frame/browser_desktop_window_tree_host_win.cc |
| index 406f558591156c6dcc7fb37d47dec0a7aa77d122..c37a63b2bb4ae0a9b66d30464e8dab23e3678dfb 100644 |
| --- a/chrome/browser/ui/views/frame/browser_desktop_window_tree_host_win.cc |
| +++ b/chrome/browser/ui/views/frame/browser_desktop_window_tree_host_win.cc |
| @@ -173,10 +173,10 @@ void BrowserDesktopWindowTreeHostWin::PostHandleMSG(UINT message, |
| // unless necessary to avoid flicker. This may be invoked during creation |
| // on XP and before the non_client_view has been created. |
| WINDOWPOS* window_pos = reinterpret_cast<WINDOWPOS*>(l_param); |
| - if (window_pos->flags & SWP_SHOWWINDOW && |
| - GetWidget()->non_client_view()) { |
| - GetWidget()->non_client_view()->Layout(); |
| - GetWidget()->non_client_view()->SchedulePaint(); |
| + auto* non_client_view = GetWidget()->non_client_view(); |
| + if (window_pos->flags & SWP_SHOWWINDOW && non_client_view) { |
| + non_client_view->Layout(); |
| + non_client_view->SchedulePaint(); |
| } |
| break; |
| } |
| @@ -199,6 +199,13 @@ void BrowserDesktopWindowTreeHostWin::PostHandleMSG(UINT message, |
| } |
| break; |
| } |
| + case WM_DWMCOLORIZATIONCOLORCHANGED: { |
| + auto* non_client_view = GetWidget()->non_client_view(); |
| + // Activation border may have changed color. |
|
Peter Kasting
2016/10/06 08:02:47
Grammar Nazi Nit: Add "The" in front
|
| + if (non_client_view) |
| + non_client_view->SchedulePaint(); |
| + break; |
| + } |
| } |
| } |
| @@ -250,20 +257,6 @@ void BrowserDesktopWindowTreeHostWin::FrameTypeChanged() { |
| // BrowserDesktopWindowTreeHostWin, private: |
| void BrowserDesktopWindowTreeHostWin::UpdateDWMFrame() { |
| - // With a custom titlebar we want the margins to always be 2 pixels, because |
| - // that gives us the 1 pixel accent color border around the window (a 1 pixel |
| - // margin is not sufficient, it will draw a messed-up-looking border instead). |
| - // The other pixel ends up being 1-pixel-thick native titlebar (including |
| - // caption buttons) but since we draw over that pixel in |
| - // GlassBrowserFrameView::PaintTitlebar() it will be invisible and won't get |
| - // mouse events. |
| - if (browser_frame_->CustomDrawSystemTitlebar() && ShouldUseNativeFrame() && |
| - !GetWidget()->IsFullscreen()) { |
| - MARGINS margins = {2, 2, 2, 2}; |
| - DwmExtendFrameIntoClientArea(GetHWND(), &margins); |
| - return; |
| - } |
| - |
| // For "normal" windows on Aero, we always need to reset the glass area |
| // correctly, even if we're not currently showing the native frame (e.g. |
| // because a theme is showing), so we explicitly check for that case rather |
| @@ -299,9 +292,10 @@ BrowserDesktopWindowTreeHostWin::GetClientEdgeThicknesses() const { |
| } |
| MARGINS BrowserDesktopWindowTreeHostWin::GetDWMFrameMargins() const { |
| - // If we're using the opaque frame or we're fullscreen we don't extend the |
| - // glass in at all because it won't be visible. |
| - if (!ShouldUseNativeFrame() || GetWidget()->IsFullscreen()) |
| + // If we're using the opaque frame or custom titlebar or we're fullscreen we |
| + // don't extend the glass in at all because it won't be visible. |
|
Peter Kasting
2016/10/06 08:02:47
Nit: Clearer (to me):
Don't extend the DWM frame
Bret
2016/10/06 20:48:10
Not quite accurate because DWM still draws non-cli
Peter Kasting
2016/10/11 20:01:38
What about:
Don't extend the DWM frame in unless
Bret
2016/10/11 20:48:19
Okay, I agree about not restating the code. Maybe
Peter Kasting
2016/10/11 20:56:51
I like your simple comment suggestion.
|
| + if (!ShouldUseNativeFrame() || GetWidget()->IsFullscreen() || |
| + browser_frame_->CustomDrawSystemTitlebar()) |
| return MARGINS{0}; |
| // The glass should extend to the bottom of the tabstrip. |