Changed the presenter to only send 'set_cursor_style' on the topmost window

co-authored-by: Antonio <antonio@zed.dev>
This commit is contained in:
Mikayla Maki 2023-01-25 08:58:41 -08:00
parent 27a80a1c94
commit 45e4e3354e
7 changed files with 54 additions and 65 deletions

View file

@ -866,10 +866,12 @@ impl MutableAppContext {
}
}
pub fn screen_position(&self, window_id: usize, view_position: &Vector2F) -> Option<Vector2F> {
pub fn is_topmost_window_for_position(&self, window_id: usize, position: Vector2F) -> bool {
self.presenters_and_platform_windows
.get(&window_id)
.map(|(_, window)| window.screen_position(view_position))
.map_or(false, |(_, window)| {
window.is_topmost_for_position(position)
})
}
pub fn window_ids(&self) -> impl Iterator<Item = usize> + '_ {