Commit 40351207 authored by David Bienvenu's avatar David Bienvenu Committed by Commit Bot

Revert "Stop removing WS_THICKFRAME style on full screen."

This reverts commit 00952e6e.

Reason for revert: <crbug.com/1141059>

Original change's description:
> 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/+/1972258
> Reviewed-by: Peter Kasting <pkasting@chromium.org>
> Reviewed-by: Nico Weber <thakis@chromium.org>
> Commit-Queue: David Bienvenu <davidbienvenu@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#791237}

TBR=pkasting@chromium.org,thakis@chromium.org,davidbienvenu@chromium.org

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: 1014720
Change-Id: I4a35fccff45ba0994157939fe5fa95107ecb0334
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2522875Reviewed-by: default avatarDavid Bienvenu <davidbienvenu@chromium.org>
Commit-Queue: David Bienvenu <davidbienvenu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#824749}
parent aaddd906
......@@ -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 its extended
// style should not have WS_EX_WINDOWEDGE and WS_EX_TOOLWINDOW.
// 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.
LONG style = ::GetWindowLong(wnd, GWL_STYLE);
LONG ext_style = ::GetWindowLong(wnd, GWL_EXSTYLE);
return !((style & WS_DLGFRAME) ||
return !((style & (WS_DLGFRAME | WS_THICKFRAME)) ||
(ext_style & (WS_EX_WINDOWEDGE | WS_EX_TOOLWINDOW)));
}
......
......@@ -72,7 +72,8 @@ void FullscreenHandler::SetFullscreenImpl(bool fullscreen) {
if (fullscreen_) {
// Set new window style and size.
SetWindowLong(hwnd_, GWL_STYLE, saved_window_info_.style & ~WS_CAPTION);
SetWindowLong(hwnd_, GWL_STYLE,
saved_window_info_.style & ~(WS_CAPTION | WS_THICKFRAME));
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