Skip to content

Commit

Permalink
Ensure Windows fullscreen styling includes visibility
Browse files Browse the repository at this point in the history
Fixes exiting fullscreen when windows are created fullscreen.
(e.g. Extension JS API: chrome.windows.create({state: 'fullscreen'}))

Windows created fullscreen have GWL_STYLE without WS_VISIBLE.
Ensure the style includes visibility to fix window breakage.

Fixed: 1062251
Change-Id: Ib4da7123781a6f591db04a696f48d4ba9c96d5df
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4778723
Commit-Queue: Peter Kasting <pkasting@chromium.org>
Auto-Submit: Mike Wasserman <msw@chromium.org>
Reviewed-by: Peter Kasting <pkasting@chromium.org>
Commit-Queue: Mike Wasserman <msw@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1183446}
  • Loading branch information
Mike Wasserman authored and Chromium LUCI CQ committed Aug 15, 2023
1 parent c97075b commit 39609ff
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ui/views/win/fullscreen_handler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,10 @@ void FullscreenHandler::ProcessFullscreen(bool fullscreen,
SWP_NOZORDER | SWP_NOACTIVATE | SWP_FRAMECHANGED);
} else {
// Restore the window style and bounds saved prior to entering fullscreen.
// Use WS_VISIBLE for windows shown after SetFullscreen: crbug.com/1062251.
// Making multiple window adjustments here is ugly, but if SetWindowPos()
// doesn't redraw, the taskbar won't be repainted.
SetWindowLong(hwnd_, GWL_STYLE, saved_window_info_.style);
SetWindowLong(hwnd_, GWL_STYLE, saved_window_info_.style | WS_VISIBLE);
SetWindowLong(hwnd_, GWL_EXSTYLE, saved_window_info_.ex_style);

gfx::Rect window_rect(saved_window_info_.rect);
Expand Down

0 comments on commit 39609ff

Please sign in to comment.