Skip to content

Commit

Permalink
fix: update Windows' cache after changing window's style (#31080)
Browse files Browse the repository at this point in the history
To enable/disable window resizing we set/unset WS_THICKFRAME style
flag on the window. Window's frame styles are cached so we need to
call SetWindowPos with the SWP_FRAMECHANGED flag set to update
cache properly.

Co-authored-by: Cezary Kulakowski <cezary@openfin.co>
  • Loading branch information
trop[bot] and CezaryKulakowski committed Sep 23, 2021
1 parent 6029315 commit f6da3b4
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions shell/browser/native_window_views.cc
Expand Up @@ -111,6 +111,11 @@ void FlipWindowStyle(HWND handle, bool on, DWORD flag) {
else
style &= ~flag;
::SetWindowLong(handle, GWL_STYLE, style);
// Window's frame styles are cached so we need to call SetWindowPos
// with the SWP_FRAMECHANGED flag to update cache properly.
::SetWindowPos(handle, 0, 0, 0, 0, 0, // ignored
SWP_FRAMECHANGED | SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER |
SWP_NOACTIVATE | SWP_NOOWNERZORDER);
}

gfx::Rect DIPToScreenRect(HWND hwnd, const gfx::Rect& pixel_bounds) {
Expand Down

0 comments on commit f6da3b4

Please sign in to comment.