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
|
@ -284,19 +284,24 @@ impl Platform for WindowsPlatform {
|
|||
unimplemented!()
|
||||
}
|
||||
|
||||
// todo(windows)
|
||||
fn displays(&self) -> Vec<Rc<dyn PlatformDisplay>> {
|
||||
vec![Rc::new(WindowsDisplay::new())]
|
||||
WindowsDisplay::displays()
|
||||
}
|
||||
|
||||
// todo(windows)
|
||||
fn display(&self, id: crate::DisplayId) -> Option<Rc<dyn PlatformDisplay>> {
|
||||
Some(Rc::new(WindowsDisplay::new()))
|
||||
if let Some(display) = WindowsDisplay::new(id) {
|
||||
Some(Rc::new(display) as Rc<dyn PlatformDisplay>)
|
||||
} else {
|
||||
None
|
||||
}
|
||||
}
|
||||
|
||||
// todo(windows)
|
||||
fn primary_display(&self) -> Option<Rc<dyn PlatformDisplay>> {
|
||||
Some(Rc::new(WindowsDisplay::new()))
|
||||
if let Some(display) = WindowsDisplay::primary_monitor() {
|
||||
Some(Rc::new(display) as Rc<dyn PlatformDisplay>)
|
||||
} else {
|
||||
None
|
||||
}
|
||||
}
|
||||
|
||||
// todo(windows)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue