aboutsummaryrefslogtreecommitdiff
path: root/alacritty/src/window.rs
diff options
context:
space:
mode:
Diffstat (limited to 'alacritty/src/window.rs')
-rw-r--r--alacritty/src/window.rs21
1 files changed, 6 insertions, 15 deletions
diff --git a/alacritty/src/window.rs b/alacritty/src/window.rs
index 953fffd9..e43e5c95 100644
--- a/alacritty/src/window.rs
+++ b/alacritty/src/window.rs
@@ -27,10 +27,12 @@ use std::fmt::{self, Display, Formatter};
use glutin::dpi::{PhysicalPosition, PhysicalSize};
use glutin::event_loop::EventLoop;
#[cfg(target_os = "macos")]
-use glutin::platform::macos::{RequestUserAttentionType, WindowBuilderExtMacOS, WindowExtMacOS};
+use glutin::platform::macos::{WindowBuilderExtMacOS, WindowExtMacOS};
#[cfg(windows)]
use glutin::platform::windows::IconExtWindows;
-use glutin::window::{CursorIcon, Fullscreen, Window as GlutinWindow, WindowBuilder, WindowId};
+use glutin::window::{
+ CursorIcon, Fullscreen, UserAttentionType, Window as GlutinWindow, WindowBuilder, WindowId,
+};
use glutin::{self, ContextBuilder, PossiblyCurrent, WindowedContext};
#[cfg(windows)]
use winapi::shared::minwindef::WORD;
@@ -328,23 +330,12 @@ impl Window {
}
}
- #[cfg(all(feature = "x11", not(any(target_os = "macos", windows))))]
- pub fn set_urgent(&self, is_urgent: bool) {
- self.window().set_urgent(is_urgent);
- }
-
- #[cfg(target_os = "macos")]
pub fn set_urgent(&self, is_urgent: bool) {
- if !is_urgent {
- return;
- }
+ let attention = if is_urgent { Some(UserAttentionType::Critical) } else { None };
- self.window().request_user_attention(RequestUserAttentionType::Critical);
+ self.window().request_user_attention(attention);
}
- #[cfg(any(windows, not(any(feature = "x11", target_os = "macos"))))]
- pub fn set_urgent(&self, _is_urgent: bool) {}
-
pub fn set_outer_position(&self, pos: PhysicalPosition<i32>) {
self.window().set_outer_position(pos);
}