1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 01:07:35 +00:00

WindowServer: Don't allow minimize/maximize of windows while modal up

While one window is blocked by another modal one, just ignore events on
the window frame, and also ignore set_minimized() and set_maximized().

The only thing you're allowed to do with a blocked window is moving it.

Fixes #1111.
This commit is contained in:
Andreas Kling 2020-01-25 10:39:09 +01:00
parent 6df81c8a88
commit b648997d1f
2 changed files with 7 additions and 0 deletions

View file

@ -153,6 +153,8 @@ void WSWindow::set_minimized(bool minimized)
return;
if (minimized && !m_minimizable)
return;
if (is_blocked_by_modal_window())
return;
m_minimized = minimized;
update_menu_item_text(PopupMenuItem::Minimize);
start_minimize_animation();
@ -193,6 +195,8 @@ void WSWindow::set_maximized(bool maximized)
return;
if (maximized && !is_resizable())
return;
if (is_blocked_by_modal_window())
return;
set_tiled(WindowTileType::None);
m_maximized = maximized;
update_menu_item_text(PopupMenuItem::Maximize);

View file

@ -306,6 +306,9 @@ void WSWindowFrame::on_mouse_event(const WSMouseEvent& event)
{
ASSERT(!m_window.is_fullscreen());
if (m_window.is_blocked_by_modal_window())
return;
auto& wm = WSWindowManager::the();
if (m_window.type() != WSWindowType::Normal)
return;