WindowServer: Don't let modals minimize themselves

But do allow them to remain minimizable by a parent. This is a nice
ergonomics fix to allow a parent window to quickly minimize and
restore all its modal children.
This commit is contained in:
thankyouverycool 2022-08-22 14:17:58 -04:00 committed by Andreas Kling
commit 2b2c317c2d
Notes: sideshowbarker 2024-07-17 07:46:52 +09:00
3 changed files with 4 additions and 4 deletions

View file

@ -107,7 +107,7 @@ void WindowFrame::window_was_constructed(Badge<Window>)
m_buttons.append(move(button));
}
if (m_window.is_minimizable()) {
if (m_window.is_minimizable() && !m_window.is_modal()) {
auto button = make<Button>(*this, [this](auto&) {
m_window.handle_window_menu_action(WindowMenuAction::MinimizeOrUnminimize);
});
@ -136,7 +136,7 @@ void WindowFrame::set_button_icons()
m_close_button->set_icon(m_window.is_modified() ? s_close_modified_icon : s_close_icon);
m_close_button->set_style(button_style);
}
if (m_window.is_minimizable()) {
if (m_window.is_minimizable() && !m_window.is_modal()) {
m_minimize_button->set_icon(s_minimize_icon);
m_minimize_button->set_style(button_style);
}