1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 02:18:11 +00:00

WindowServer: Don't crash when minimizing Eyes

Or any other window that globally tracks the mouse cursor.
This commit is contained in:
Sergey Bugaev 2020-05-25 13:29:11 +03:00 committed by Andreas Kling
parent 431bbde6df
commit c1a26f0b35

View file

@ -761,10 +761,8 @@ void WindowManager::process_mouse_event(MouseEvent& event, Window*& hovered_wind
HashTable<Window*> windows_who_received_mouse_event_due_to_cursor_tracking;
for (auto* window = m_windows_in_order.tail(); window; window = window->prev()) {
if (!window->global_cursor_tracking())
if (!window->global_cursor_tracking() || !window->is_visible() || window->is_minimized())
continue;
ASSERT(window->is_visible()); // Maybe this should be supported? Idk. Let's catch it and think about it later.
ASSERT(!window->is_minimized()); // Maybe this should also be supported? Idk.
windows_who_received_mouse_event_due_to_cursor_tracking.set(window);
auto translated_event = event.translated(-window->position());
deliver_mouse_event(*window, translated_event);