Skip to content
This repository has been archived by the owner on Oct 30, 2023. It is now read-only.

Commit

Permalink
fix: allow maximizing when window enters tablet mode with WCO (electr…
Browse files Browse the repository at this point in the history
…on#35617)

* fix: Backport CL 3753528 for WCO

* Update comment

* Update shell/browser/ui/views/win_caption_button_container.cc

Co-authored-by: Robo <hop2deep@gmail.com>

Co-authored-by: Robo <hop2deep@gmail.com>
  • Loading branch information
2 people authored and khalwa committed Feb 22, 2023
1 parent 0117757 commit b920ec6
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions shell/browser/ui/views/win_caption_button_container.cc
Expand Up @@ -159,10 +159,11 @@ void WinCaptionButtonContainer::UpdateButtons() {
const bool is_touch = ui::TouchUiController::Get()->touch_ui();
restore_button_->SetEnabled(!is_touch);

// The maximize button should only be enabled if the window is
// maximizable *and* touch mode is disabled.
// In touch mode, windows cannot be taken out of fullscreen or tiled mode, so
// the maximize/restore button should be disabled, unless the window is not
// maximized.
const bool maximizable = frame_view_->window()->IsMaximizable();
maximize_button_->SetEnabled(!is_touch && maximizable);
maximize_button_->SetEnabled(!(is_touch && is_maximized) && maximizable);

const bool closable = frame_view_->window()->IsClosable();
close_button_->SetEnabled(closable);
Expand Down

0 comments on commit b920ec6

Please sign in to comment.