diff options
author | Tom <tomut@yahoo.com> | 2021-01-07 22:17:45 -0700 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-01-08 11:21:30 +0100 |
commit | edc18ab4e60dcb412a23715ab6ae1a06a74e2fa4 (patch) | |
tree | 1903bbd2201b3603f5a4a6bef1951742461daccd | |
parent | d0a9954f0e8393c0eb68ca53bd246ed10d137361 (diff) | |
download | serenity-edc18ab4e60dcb412a23715ab6ae1a06a74e2fa4.zip |
WindowServer: Start blocked modal animation when clicking on frame
Fixes #4835
-rw-r--r-- | Services/WindowServer/WindowManager.cpp | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/Services/WindowServer/WindowManager.cpp b/Services/WindowServer/WindowManager.cpp index 6a473c1caf..9550c70ae9 100644 --- a/Services/WindowServer/WindowManager.cpp +++ b/Services/WindowServer/WindowManager.cpp @@ -993,20 +993,21 @@ void WindowManager::process_mouse_event(MouseEvent& event, Window*& hovered_wind return; } + ASSERT(window.frame().rect().contains(event.position())); + if (event.type() == Event::MouseDown) { + // We're clicking on something that's blocked by a modal window. + // Flash the modal window to let the user know about it. + if (auto* blocking_modal_window = window.is_blocked_by_modal_window()) + blocking_modal_window->frame().start_flash_animation(); + + if (window.type() == WindowType::Normal) + move_to_front_and_make_active(window); + else if (window.type() == WindowType::Desktop) + set_active_window(&window); + } + // Well okay, let's see if we're hitting the frame or the window inside the frame. if (window.rect().contains(event.position())) { - if (event.type() == Event::MouseDown) { - // We're clicking on something that's blocked by a modal window. - // Flash the modal window to let the user know about it. - if (auto* blocking_modal_window = window.is_blocked_by_modal_window()) - blocking_modal_window->frame().start_flash_animation(); - - if (window.type() == WindowType::Normal) - move_to_front_and_make_active(window); - else if (window.type() == WindowType::Desktop) - set_active_window(&window); - } - hovered_window = &window; if (!window.global_cursor_tracking() && !windows_who_received_mouse_event_due_to_cursor_tracking.contains(&window) && !window.is_blocked_by_modal_window()) { auto translated_event = event.translated(-window.position()); |