1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 03:57:43 +00:00

LibGUI+Taskbar+WindowServer: Prevent minimization when blocked

This was intentionally enabled with WindowModes as a new Taskbar
convenience, but on second thought, it doesn't add up visually.

Taskbar buttons show blockers' context menus when available,
which is a bit confusing when the window isn't visible. The
modeless window's disabled context menu options and inactive title
bar also contradict the button. So, this patch reenables the
restriction for now. Blocking modals you don't want to answer to
immediately can still be tucked away on another workspace.
This commit is contained in:
thankyouverycool 2022-08-25 14:03:49 -04:00 committed by Andreas Kling
parent 18b111b802
commit d815f659cc
7 changed files with 18 additions and 8 deletions

View file

@ -432,6 +432,7 @@ void WindowManager::tell_wm_about_window(WMConnectionFromClient& conn, Window& w
Window* modeless = window.modeless_ancestor();
if (!modeless)
return;
bool is_blocked = modeless->blocking_modal_window();
auto is_active = for_each_window_in_modal_chain(*modeless, [&](auto& w) {
if (w.is_active())
return IterationDecision::Break;
@ -439,7 +440,7 @@ void WindowManager::tell_wm_about_window(WMConnectionFromClient& conn, Window& w
});
auto& window_stack = is_stationary_window_type(modeless->type()) ? current_window_stack() : modeless->window_stack();
conn.async_window_state_changed(conn.window_id(), modeless->client_id(), modeless->window_id(), window_stack.row(), window_stack.column(), is_active, modeless->is_minimized(), modeless->is_frameless(), (i32)modeless->type(), modeless->computed_title(), modeless->rect(), modeless->progress());
conn.async_window_state_changed(conn.window_id(), modeless->client_id(), modeless->window_id(), window_stack.row(), window_stack.column(), is_active, is_blocked, modeless->is_minimized(), modeless->is_frameless(), (i32)modeless->type(), modeless->computed_title(), modeless->rect(), modeless->progress());
}
void WindowManager::tell_wm_about_window_rect(WMConnectionFromClient& conn, Window& window)