mirror of
https://github.com/italicsjenga/winit-sonoma-fix.git
synced 2025-01-23 10:26:34 +11:00
Remove incorrect unreachable usage when guessing DPI factor (#592)
This commit is contained in:
parent
ec393e4a90
commit
040d3f5d8b
3 changed files with 3 additions and 2 deletions
|
@ -1,6 +1,7 @@
|
|||
# Unreleased
|
||||
|
||||
- On Windows, non-resizable windows now have the maximization button disabled. This is consistent with behavior on macOS and popular X11 WMs.
|
||||
- Corrected incorrect `unreachable!` usage when guessing the DPI factor with no detected monitors.
|
||||
|
||||
# Version 0.16.1 (2018-07-02)
|
||||
|
||||
|
|
|
@ -102,7 +102,7 @@ impl UnownedWindow {
|
|||
.unwrap_or(1.0)
|
||||
})
|
||||
} else {
|
||||
unreachable!("There are no detected monitors, which should've already caused a panic.");
|
||||
return Err(OsError(format!("No monitors were detected.")));
|
||||
};
|
||||
|
||||
info!("Guessed window DPI factor: {}", dpi_factor);
|
||||
|
|
|
@ -872,7 +872,7 @@ unsafe fn init(
|
|||
}
|
||||
dpi_factor
|
||||
} else {
|
||||
unreachable!("There are no detected monitors, which should've already caused a panic.");
|
||||
return Err(CreationError::OsError(format!("No monitors were detected.")));
|
||||
};
|
||||
dpi_factor.unwrap_or_else(|| {
|
||||
util::get_cursor_pos()
|
||||
|
|
Loading…
Add table
Reference in a new issue