WindowServer: Always use the automatic cursor tracking window's cursor

Whenever we're in the "automatic cursor tracking" state, we should only
display the tracking window's cursor, as the state is globally modal.
This commit is contained in:
Andreas Kling 2022-08-15 22:44:17 +02:00
parent 296e68fdbf
commit 072dde9387
Notes: sideshowbarker 2024-07-17 08:13:23 +09:00

View file

@ -1971,7 +1971,10 @@ Cursor const& WindowManager::active_cursor() const
} }
} }
if (m_hovered_window) { if (m_automatic_cursor_tracking_window) {
if (m_automatic_cursor_tracking_window->cursor())
return *m_automatic_cursor_tracking_window->cursor();
} else if (m_hovered_window) {
if (auto* modal_window = const_cast<Window&>(*m_hovered_window).blocking_modal_window()) { if (auto* modal_window = const_cast<Window&>(*m_hovered_window).blocking_modal_window()) {
if (modal_window->cursor()) if (modal_window->cursor())
return *modal_window->cursor(); return *modal_window->cursor();