WIP - adds platform APIs for checking the top most window

This commit is contained in:
Mikayla Maki 2023-01-20 18:10:24 -08:00
parent a66a0cfd70
commit 426aeb7c5e
9 changed files with 126 additions and 5 deletions

View file

@ -21,6 +21,7 @@ use std::{
use anyhow::{anyhow, Context, Result};
use lazy_static::lazy_static;
use parking_lot::Mutex;
use pathfinder_geometry::vector::Vector2F;
use postage::oneshot;
use smallvec::SmallVec;
use smol::prelude::*;
@ -865,6 +866,12 @@ impl MutableAppContext {
}
}
pub fn screen_position(&self, window_id: usize, view_position: &Vector2F) -> Option<Vector2F> {
self.presenters_and_platform_windows
.get(&window_id)
.map(|(_, window)| window.screen_position(view_position))
}
pub fn window_ids(&self) -> impl Iterator<Item = usize> + '_ {
self.cx.windows.keys().cloned()
}