Make 'primary_monitor' return 'Option<MonitorHandle>'
Certain platforms like Wayland don't have a concept of primary Monitor in particular. To indicate that 'primary_monitor' will return 'None' as well as in cases where the primary monitor can't be detected. Fixes #1683.
This commit is contained in:
parent
cac627ed05
commit
d103dc2631
16 changed files with 86 additions and 56 deletions
|
|
@ -10,8 +10,7 @@ use crate::{
|
|||
error::{ExternalError, NotSupportedError, OsError as RootOsError},
|
||||
monitor::MonitorHandle as RootMonitorHandle,
|
||||
platform_impl::{
|
||||
platform::wayland::event_loop::{available_monitors, primary_monitor},
|
||||
MonitorHandle as PlatformMonitorHandle,
|
||||
platform::wayland::event_loop::available_monitors, MonitorHandle as PlatformMonitorHandle,
|
||||
PlatformSpecificWindowBuilderAttributes as PlAttributes,
|
||||
},
|
||||
window::{CursorIcon, Fullscreen, WindowAttributes},
|
||||
|
|
@ -410,8 +409,9 @@ impl Window {
|
|||
available_monitors(&self.outputs)
|
||||
}
|
||||
|
||||
pub fn primary_monitor(&self) -> MonitorHandle {
|
||||
primary_monitor(&self.outputs)
|
||||
pub fn primary_monitor(&self) -> Option<RootMonitorHandle> {
|
||||
// Wayland doesn't have a notion of primary monitor.
|
||||
None
|
||||
}
|
||||
|
||||
pub fn raw_window_handle(&self) -> WaylandHandle {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue