mirror of
https://github.com/storytold/winit.git
synced 2026-11-25 22:00:45 +01:00
MacOS: request_user_attention(bool -> enum) (#1021)
This commit is contained in:
1 parent
53a89f28a0
commit
c1f314ccdc
3 files changed
+31
-12
No files matched your search
@@ -28,7 +28,7 @@ use crate::{
|
||||
error::{ExternalError, NotSupportedError, OsError as RootOsError},
|
||||
icon::Icon,
|
||||
monitor::MonitorHandle as RootMonitorHandle,
|
||||
platform::macos::{ActivationPolicy, WindowExtMacOS},
|
||||
platform::macos::{ActivationPolicy, RequestUserAttentionType, WindowExtMacOS},
|
||||
platform_impl::platform::{
|
||||
app_state::AppState,
|
||||
ffi,
|
||||
@@ -778,11 +778,13 @@ impl WindowExtMacOS for UnownedWindow {
|
||||
}
|
||||
|
||||
#[inline]
|
||||
fn request_user_attention(&self, is_critical: bool) {
|
||||
fn request_user_attention(&self, request_type: RequestUserAttentionType) {
|
||||
unsafe {
|
||||
NSApp().requestUserAttention_(match is_critical {
|
||||
true => NSRequestUserAttentionType::NSCriticalRequest,
|
||||
false => NSRequestUserAttentionType::NSInformationalRequest,
|
||||
NSApp().requestUserAttention_(match request_type {
|
||||
RequestUserAttentionType::Critical => NSRequestUserAttentionType::NSCriticalRequest,
|
||||
RequestUserAttentionType::Informational => {
|
||||
NSRequestUserAttentionType::NSInformationalRequest
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user