Store AnyWindowHandles instead of usizes

This commit is contained in:
Nathan Sobo 2023-08-08 16:06:53 -06:00
parent 1e8a9ccdb5
commit afd89b256a
9 changed files with 117 additions and 134 deletions

View file

@ -6,7 +6,7 @@ use crate::{
executor,
keymap_matcher::KeymapMatcher,
platform::{self, AppVersion, CursorStyle, Event},
Action, ClipboardItem, Menu, MenuItem,
Action, AnyWindowHandle, ClipboardItem, Menu, MenuItem,
};
use anyhow::{anyhow, Result};
use block::ConcreteBlock;
@ -590,18 +590,18 @@ impl platform::Platform for MacPlatform {
fn open_window(
&self,
id: usize,
handle: AnyWindowHandle,
options: platform::WindowOptions,
executor: Rc<executor::Foreground>,
) -> Box<dyn platform::Window> {
Box::new(Window::open(id, options, executor, self.fonts()))
Box::new(Window::open(handle, options, executor, self.fonts()))
}
fn main_window_id(&self) -> Option<usize> {
Window::main_window_id()
fn main_window(&self) -> Option<AnyWindowHandle> {
Window::main_window()
}
fn add_status_item(&self, _id: usize) -> Box<dyn platform::Window> {
fn add_status_item(&self, _handle: AnyWindowHandle) -> Box<dyn platform::Window> {
Box::new(StatusItem::add(self.fonts()))
}