summaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorananta <ananta@chromium.org>2016-03-21 16:13:21 -0700
committerCommit bot <commit-bot@chromium.org>2016-03-21 23:14:48 +0000
commit9f060d4be347cda7aa7c0fb2a43afafbbd64e70c (patch)
treec71715dd61a8a8aff51f52e6a5236b8790c3335b /ui
parent21b5cdfb87eb6c33fb5c1a08774460f9ac90352e (diff)
downloadchromium_src-9f060d4be347cda7aa7c0fb2a43afafbbd64e70c.zip
chromium_src-9f060d4be347cda7aa7c0fb2a43afafbbd64e70c.tar.gz
chromium_src-9f060d4be347cda7aa7c0fb2a43afafbbd64e70c.tar.bz2
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.
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}
Diffstat (limited to 'ui')
-rw-r--r--ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc5
-rw-r--r--ui/views/win/hwnd_message_handler.cc2
2 files changed, 4 insertions, 3 deletions
diff --git a/ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc b/ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc
index 9f58b13..05323aa 100644
--- a/ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc
+++ b/ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc
@@ -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());
+ }
}
////////////////////////////////////////////////////////////////////////////////
diff --git a/ui/views/win/hwnd_message_handler.cc b/ui/views/win/hwnd_message_handler.cc
index 7efa0a5..531b488 100644
--- a/ui/views/win/hwnd_message_handler.cc
+++ b/ui/views/win/hwnd_message_handler.cc
@@ -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;
}
}