WindowServer: Show modal window's cursor over blocked windows

When a window is blocked by a modal window from the same application,
we now prefer the modal window's cursor instead of the hovered window.
This commit is contained in:
Andreas Kling 2020-11-10 19:30:22 +01:00
parent 75f61fe3d9
commit ebaf20547c
Notes: sideshowbarker 2024-07-19 01:27:28 +09:00

View file

@ -1306,8 +1306,14 @@ const Cursor& WindowManager::active_cursor() const
}
}
if (m_hovered_window && m_hovered_window->cursor())
return *m_hovered_window->cursor();
if (m_hovered_window) {
if (auto* modal_window = const_cast<Window&>(*m_hovered_window).is_blocked_by_modal_window()) {
if (modal_window->cursor())
return *modal_window->cursor();
} else if (m_hovered_window->cursor()) {
return *m_hovered_window->cursor();
}
}
return *m_arrow_cursor;
}