mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 18:28:12 +00:00
WindowServer: Always restore modal chain when clicking a window
Refactors restore helper into move_to_front_and_make_active(). Fixes not bringing all modal children to the front when any modal child or its modeless parent is clicked.
This commit is contained in:
parent
d815f659cc
commit
aa045a9fdf
4 changed files with 8 additions and 13 deletions
|
@ -63,7 +63,7 @@ void WMConnectionFromClient::set_active_window(i32 client_id, i32 window_id)
|
|||
return;
|
||||
}
|
||||
auto& window = *(*it).value;
|
||||
WindowManager::the().restore_modal_chain(window);
|
||||
WindowManager::the().move_to_front_and_make_active(window);
|
||||
}
|
||||
|
||||
void WMConnectionFromClient::popup_window_menu(i32 client_id, i32 window_id, Gfx::IntPoint const& screen_position)
|
||||
|
|
|
@ -342,6 +342,12 @@ void WindowManager::add_window(Window& window)
|
|||
|
||||
void WindowManager::move_to_front_and_make_active(Window& window)
|
||||
{
|
||||
for_each_window_in_modal_chain(window, [&](auto& w) {
|
||||
w.set_minimized(false);
|
||||
w.window_stack().move_to_front(w);
|
||||
return IterationDecision::Continue;
|
||||
});
|
||||
|
||||
auto* blocker = window.blocking_modal_window();
|
||||
if (blocker && !window.is_capturing_input()) {
|
||||
blocker->window_stack().move_to_front(*blocker);
|
||||
|
@ -2134,16 +2140,6 @@ void WindowManager::did_popup_a_menu(Badge<Menu>)
|
|||
set_automatic_cursor_tracking_window(nullptr);
|
||||
}
|
||||
|
||||
void WindowManager::restore_modal_chain(Window& window)
|
||||
{
|
||||
for_each_window_in_modal_chain(window, [&](auto& w) {
|
||||
w.set_minimized(false);
|
||||
w.window_stack().move_to_front(w);
|
||||
return IterationDecision::Continue;
|
||||
});
|
||||
move_to_front_and_make_active(window);
|
||||
}
|
||||
|
||||
void WindowManager::minimize_windows(Window& window, bool minimized)
|
||||
{
|
||||
for_each_window_in_modal_chain(window, [&](auto& w) {
|
||||
|
|
|
@ -233,7 +233,6 @@ public:
|
|||
void start_menu_doubleclick(Window& window, MouseEvent const& event);
|
||||
bool is_menu_doubleclick(Window& window, MouseEvent const& event) const;
|
||||
|
||||
void restore_modal_chain(Window&);
|
||||
void minimize_windows(Window&, bool);
|
||||
void hide_windows(Window&, bool);
|
||||
void maximize_windows(Window&, bool);
|
||||
|
|
|
@ -90,7 +90,7 @@ void WindowSwitcher::on_key_event(KeyEvent const& event)
|
|||
if (event.type() == Event::KeyUp) {
|
||||
if (event.key() == (m_mode == Mode::ShowAllWindows ? Key_Super : Key_Alt)) {
|
||||
if (auto* window = selected_window()) {
|
||||
WindowManager::the().restore_modal_chain(*window);
|
||||
WindowManager::the().move_to_front_and_make_active(*window);
|
||||
}
|
||||
WindowManager::the().set_highlight_window(nullptr);
|
||||
hide();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue