Skip to content

Commit

Permalink
fix: WCO pressed background state updates
Browse files Browse the repository at this point in the history
  • Loading branch information
codebytere committed Jun 28, 2022
1 parent 47afadd commit cfee973
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
7 changes: 7 additions & 0 deletions shell/browser/native_window_views_win.cc
Expand Up @@ -439,6 +439,13 @@ void NativeWindowViews::HandleSizeEvent(WPARAM w_param, LPARAM l_param) {
default:
break;
}
// If a given window was minimized/maximized and has since been
// restored, ensure the WCO buttons are set to normal state.
auto* ncv = widget()->non_client_view();
if (titlebar_overlay_enabled() && ncv) {
auto* frame_view = static_cast<WinFrameView*>(ncv->frame_view());
frame_view->caption_button_container()->ResetWindowControls();
}
break;
}
}
Expand Down
5 changes: 3 additions & 2 deletions shell/browser/ui/views/win_caption_button_container.h
Expand Up @@ -46,6 +46,9 @@ class WinCaptionButtonContainer : public views::View,
// time, and both are disabled in tablet UI mode.
void UpdateButtons();

// Reset window button states to STATE_NORMAL.
void ResetWindowControls();

private:
// views::View:
void AddedToWidget() override;
Expand All @@ -55,8 +58,6 @@ class WinCaptionButtonContainer : public views::View,
void OnWidgetBoundsChanged(views::Widget* widget,
const gfx::Rect& new_bounds) override;

void ResetWindowControls();

WinFrameView* const frame_view_;
WinCaptionButton* const minimize_button_;
WinCaptionButton* const maximize_button_;
Expand Down

0 comments on commit cfee973

Please sign in to comment.