Skip to content

Commit

Permalink
WindowServer: Send WindowDeactivated event to windows blocked by modal
Browse files Browse the repository at this point in the history
When a new modal window is created, we still want to forward the
WindowDeactivated event to its parent window, despite it being blocked
by the newly created modal (which causes WindowServer's Window::event()
to ignore all incoming events from WindowManager for that window).

This fixes the "terminal doesn't stop blinking when blocked by modal
window" bug.
  • Loading branch information
linusg authored and awesomekling committed Dec 31, 2020
1 parent e27d281 commit c0356fc
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions Services/WindowServer/Window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -330,8 +330,12 @@ void Window::event(Core::Event& event)
return;
}

if (is_blocked_by_modal_window())
return;
if (is_blocked_by_modal_window()) {
// We still want to handle the WindowDeactivated event below when a new modal is
// created to notify its parent window, despite it being "blocked by modal window".
if (event.type() != Event::WindowDeactivated)
return;
}

if (static_cast<Event&>(event).is_mouse_event())
return handle_mouse_event(static_cast<const MouseEvent&>(event));
Expand Down

0 comments on commit c0356fc

Please sign in to comment.