Commit 00952e6e authored by David Bienvenu's avatar David Bienvenu Committed by Commit Bot

Stop removing WS_THICKFRAME style on full screen.

Also, change IsFullScreenWindowMode to not require the absence of
WS_THICKFRAME when deciding if a window is full screen.

This issue this fixes involves the glass_browser_frame_view when
maximizing after going full screen - an extra 8 pixel bar gets drawn
above a maximized window, and if there's another monitor
above the one with chrome maximized, the bar gets drawn on
the other monitor.

Windows doc
 https://docs.microsoft.com/en-us/windows/win32/winmsg/window-styles
claims that some styles can't be changed after the window is
created, but also says that if you change frame styles, you
need to call SetWindowPos with SWP_FRAMECHANGED, which we are doing.

Not removing the WS_THICKFRAME style doesn't seem to have any visible
effect on full screen windows.

Bug: 1014720
Change-Id: Ibfbd480c603fd7c3aca74081201e99e59fbbbecc
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1972258Reviewed-by: default avatarPeter Kasting <pkasting@chromium.org>
Reviewed-by: default avatarNico Weber <thakis@chromium.org>
Commit-Queue: David Bienvenu <davidbienvenu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#791237}
parent 53b1a164
......@@ -47,11 +47,11 @@ bool IsFullScreenWindowMode() {
if (!::EqualRect(&wnd_rect, &monitor_info.rcMonitor))
return false;
// At last, the window style should not have WS_DLGFRAME and WS_THICKFRAME and
// its extended style should not have WS_EX_WINDOWEDGE and WS_EX_TOOLWINDOW.
// At last, the window style should not have WS_DLGFRAME and its extended
// style should not have WS_EX_WINDOWEDGE and WS_EX_TOOLWINDOW.
LONG style = ::GetWindowLong(wnd, GWL_STYLE);
LONG ext_style = ::GetWindowLong(wnd, GWL_EXSTYLE);
return !((style & (WS_DLGFRAME | WS_THICKFRAME)) ||
return !((style & WS_DLGFRAME) ||
(ext_style & (WS_EX_WINDOWEDGE | WS_EX_TOOLWINDOW)));
}
......
......@@ -72,8 +72,7 @@ void FullscreenHandler::SetFullscreenImpl(bool fullscreen) {
if (fullscreen_) {
// Set new window style and size.
SetWindowLong(hwnd_, GWL_STYLE,
saved_window_info_.style & ~(WS_CAPTION | WS_THICKFRAME));
SetWindowLong(hwnd_, GWL_STYLE, saved_window_info_.style & ~WS_CAPTION);
SetWindowLong(
hwnd_, GWL_EXSTYLE,
saved_window_info_.ex_style & ~(WS_EX_DLGMODALFRAME | WS_EX_WINDOWEDGE |
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment