Don't panic when getting refresh rate failed (#2533)
This fixes a crash on macOS when trying to get the monitor refresh rate from the disabled monitor. Co-authored-by: Jet Spark <lixiaopeng.jetspark@bytedance.com> Co-authored-by: Mads Marquart <mads@marquart.dk>
This commit is contained in:
parent
94688a62f0
commit
32784af3c4
4 changed files with 13 additions and 7 deletions
|
|
@ -143,6 +143,9 @@ impl MonitorHandle {
|
|||
|
||||
/// The monitor refresh rate used by the system.
|
||||
///
|
||||
/// Return `Some` if succeed, or `None` if failed, which usually happens when the monitor
|
||||
/// the window is on is removed.
|
||||
///
|
||||
/// When using exclusive fullscreen, the refresh rate of the [`VideoMode`] that was used to
|
||||
/// enter fullscreen should be used instead.
|
||||
#[inline]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue