mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 15:27:35 +00:00
WindowServer: Handle global cursor tracking before ongoing drag/move/resize
In the case of an ongoing window drag/move/resize action WindowManager::process_mouse_event() would return early, even before delivering mouse events to windows with global cursor tracking enabled. They would only continue to receive new mouse events once those actions were completed. Fixes #3116.
This commit is contained in:
parent
c8f8f4e6c3
commit
d979379a99
1 changed files with 10 additions and 10 deletions
|
@ -871,6 +871,16 @@ void WindowManager::deliver_mouse_event(Window& window, MouseEvent& event)
|
||||||
|
|
||||||
void WindowManager::process_mouse_event(MouseEvent& event, Window*& hovered_window)
|
void WindowManager::process_mouse_event(MouseEvent& event, Window*& hovered_window)
|
||||||
{
|
{
|
||||||
|
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() || !window->is_visible() || window->is_minimized() || window->is_blocked_by_modal_window())
|
||||||
|
continue;
|
||||||
|
windows_who_received_mouse_event_due_to_cursor_tracking.set(window);
|
||||||
|
auto translated_event = event.translated(-window->position());
|
||||||
|
deliver_mouse_event(*window, translated_event);
|
||||||
|
}
|
||||||
|
|
||||||
hovered_window = nullptr;
|
hovered_window = nullptr;
|
||||||
|
|
||||||
if (process_ongoing_drag(event, hovered_window))
|
if (process_ongoing_drag(event, hovered_window))
|
||||||
|
@ -889,16 +899,6 @@ void WindowManager::process_mouse_event(MouseEvent& event, Window*& hovered_wind
|
||||||
if (m_hovered_button && event.type() == Event::MouseMove)
|
if (m_hovered_button && event.type() == Event::MouseMove)
|
||||||
m_hovered_button->on_mouse_event(event.translated(-m_hovered_button->screen_rect().location()));
|
m_hovered_button->on_mouse_event(event.translated(-m_hovered_button->screen_rect().location()));
|
||||||
|
|
||||||
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() || !window->is_visible() || window->is_minimized() || window->is_blocked_by_modal_window())
|
|
||||||
continue;
|
|
||||||
windows_who_received_mouse_event_due_to_cursor_tracking.set(window);
|
|
||||||
auto translated_event = event.translated(-window->position());
|
|
||||||
deliver_mouse_event(*window, translated_event);
|
|
||||||
}
|
|
||||||
|
|
||||||
// FIXME: Now that the menubar has a dedicated window, is this special-casing really necessary?
|
// FIXME: Now that the menubar has a dedicated window, is this special-casing really necessary?
|
||||||
if (MenuManager::the().has_open_menu() || menubar_rect().contains(event.position())) {
|
if (MenuManager::the().has_open_menu() || menubar_rect().contains(event.position())) {
|
||||||
clear_resize_candidate();
|
clear_resize_candidate();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue