Skip to content

Commit eb3477b

Browse files
author
Anantanarayanan Iyengar
committed
Fix a painting bug which occurred due to the change which reduces the size of the fullscreen chrome window by 1 px on activation loss.
Merging to M50 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 TBR=sky Review URL: https://codereview.chromium.org/1819633002 Cr-Commit-Position: refs/heads/master@{#382429} (cherry picked from commit 9f060d4) Conflicts: ui/views/win/hwnd_message_handler.cc Review URL: https://codereview.chromium.org/1826703002 . Cr-Commit-Position: refs/branch-heads/2661@{crosswalk-project#353} Cr-Branched-From: ef6f6ae-refs/heads/master@{#378081}
1 parent a37d846 commit eb3477b

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -912,9 +912,10 @@ void DesktopWindowTreeHostWin::HandleWindowSizeChanged() {
912912
// changed (can occur on Windows 10 when snapping a window to the side of
913913
// the screen). In that case do a resize to the current size to reenable
914914
// swaps.
915-
if (compositor())
915+
if (compositor()) {
916916
compositor()->SetScaleAndSize(compositor()->device_scale_factor(),
917-
compositor()->size());
917+
GetBounds().size());
918+
}
918919
}
919920

920921
////////////////////////////////////////////////////////////////////////////////

ui/views/win/hwnd_message_handler.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1060,11 +1060,11 @@ void HWNDMessageHandler::PostProcessActivateMessage(
10601060
} else if (background_fullscreen_hack_) {
10611061
// Restore the bounds of the window to fullscreen.
10621062
DCHECK(fullscreen_handler_->fullscreen());
1063-
background_fullscreen_hack_ = false;
10641063
MONITORINFO monitor_info = {sizeof(monitor_info)};
10651064
GetMonitorInfo(MonitorFromWindow(hwnd(), MONITOR_DEFAULTTOPRIMARY),
10661065
&monitor_info);
10671066
SetBoundsInternal(gfx::Rect(monitor_info.rcMonitor), false);
1067+
background_fullscreen_hack_ = false;
10681068
}
10691069
}
10701070

0 commit comments

Comments
 (0)