mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 11:58:12 +00:00
WindowServer: Start blocked modal animation when clicking on frame
Fixes #4835
This commit is contained in:
parent
d0a9954f0e
commit
edc18ab4e6
1 changed files with 13 additions and 12 deletions
|
@ -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());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue