Windows: impl WindowsDisplay
(#9287)
Tested on my laptop, and I've noticed that when I move the window, `WindowsPlatform::displays()` is being continuously called. Is this intended? Release Notes: - N/A
This commit is contained in:
parent
36cbfbfb94
commit
3274cc93df
5 changed files with 173 additions and 37 deletions
|
@ -637,6 +637,7 @@ struct Callbacks {
|
|||
pub(crate) struct WindowsWindow {
|
||||
inner: Rc<WindowsWindowInner>,
|
||||
drag_drop_handler: IDropTarget,
|
||||
display: Rc<WindowsDisplay>,
|
||||
}
|
||||
|
||||
struct WindowCreateContext {
|
||||
|
@ -701,9 +702,12 @@ impl WindowsWindow {
|
|||
};
|
||||
drag_drop_handler
|
||||
};
|
||||
// todo(windows) move window to target monitor
|
||||
// options.display_id
|
||||
let wnd = Self {
|
||||
inner: context.inner.unwrap(),
|
||||
drag_drop_handler,
|
||||
display: Rc::new(WindowsDisplay::primary_monitor().unwrap()),
|
||||
};
|
||||
platform_inner
|
||||
.raw_window_handles
|
||||
|
@ -780,9 +784,8 @@ impl PlatformWindow for WindowsWindow {
|
|||
WindowAppearance::Dark
|
||||
}
|
||||
|
||||
// todo(windows)
|
||||
fn display(&self) -> Rc<dyn PlatformDisplay> {
|
||||
Rc::new(WindowsDisplay::new())
|
||||
self.display.clone()
|
||||
}
|
||||
|
||||
fn mouse_position(&self) -> Point<Pixels> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue