Skip to content

Commit

Permalink
WindowServer: Show modal window's cursor over blocked windows
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
awesomekling committed Nov 10, 2020
1 parent 75f61fe commit ebaf205
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions Services/WindowServer/WindowManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit ebaf205

Please sign in to comment.