Use platform API to request mouse position

Co-Authored-By: Conrad Irwin <conrad@zed.dev>
This commit is contained in:
Nathan Sobo 2023-08-23 12:57:33 -06:00
parent 5996b6b46b
commit 684db11afd
8 changed files with 35 additions and 24 deletions

View file

@ -1363,14 +1363,7 @@ impl AppContext {
window: handle,
}));
let mouse_position = self.platform.mouse_position();
let mut window = Window::new(
handle,
platform_window,
mouse_position,
self,
build_root_view,
);
let mut window = Window::new(handle, platform_window, self, build_root_view);
let mut cx = WindowContext::mutable(self, &mut window, handle);
cx.layout(false).expect("initial layout should not error");
let scene = cx.paint().expect("initial paint should not error");