Skip to content

Commit

Permalink
Fix a painting bug which occurred due to the change which reduces the…
Browse files Browse the repository at this point in the history
… size of the fullscreen chrome window by 1 px on activation loss.

We reduce the size of fullscreen windows by 1px to ensure that maximized windows on the same thread don't draw over the
taskbar. This change caused a painting problem as the compositor was not aware of the changed size. This causes the compositor
to not paint correctly when the fullscreen window is activated as the window size did not change.

Setting the compositor size correctly to the window bounds size fixes this problem. The other bug I found was when the
fullscreen window is activated, we inform the delegate about the changed client size which in turn makes it across to the
webcontents. We don't want the webcontents to get notified about these size changes. Fixed by setting the flag background_fullscreen_hack_
to false after the SetBoundsInternal call.

BUG=595666

Review URL: https://codereview.chromium.org/1819633002

Cr-Commit-Position: refs/heads/master@{#382429}
  • Loading branch information
ananta authored and Commit bot committed Mar 21, 2016
1 parent 21b5cdf commit 9f060d4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc
Original file line number Diff line number Diff line change
Expand Up @@ -917,9 +917,10 @@ void DesktopWindowTreeHostWin::HandleWindowSizeChanged() {
// changed (can occur on Windows 10 when snapping a window to the side of
// the screen). In that case do a resize to the current size to reenable
// swaps.
if (compositor())
if (compositor()) {
compositor()->SetScaleAndSize(compositor()->device_scale_factor(),
compositor()->size());
GetBounds().size());
}
}

////////////////////////////////////////////////////////////////////////////////
Expand Down
2 changes: 1 addition & 1 deletion ui/views/win/hwnd_message_handler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1043,11 +1043,11 @@ void HWNDMessageHandler::PostProcessActivateMessage(
} else if (background_fullscreen_hack_) {
// Restore the bounds of the window to fullscreen.
DCHECK(IsFullscreen());
background_fullscreen_hack_ = false;
MONITORINFO monitor_info = {sizeof(monitor_info)};
GetMonitorInfo(MonitorFromWindow(hwnd(), MONITOR_DEFAULTTOPRIMARY),
&monitor_info);
SetBoundsInternal(gfx::Rect(monitor_info.rcMonitor), false);
background_fullscreen_hack_ = false;
}
}

Expand Down

0 comments on commit 9f060d4

Please sign in to comment.