Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: allow maximizing when window enters tablet mode with WCO #35617

Merged
merged 3 commits into from Sep 13, 2022
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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);
rzhao271 marked this conversation as resolved.
Show resolved Hide resolved

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