Add RequestUserAttention to window::Action

This commit is contained in:
Night_Hunter 2022-12-10 01:53:00 +13:00 committed by Héctor Ramón Jiménez
parent 54105a24e1
commit d95b9bf244
No known key found for this signature in database
GPG key ID: 140CC052C94F138E
4 changed files with 64 additions and 11 deletions

View file

@ -0,0 +1,21 @@
/// The type of user attention to request.
///
/// ## Platform-specific
///
/// - **X11:** Sets the WM's `XUrgencyHint`. No distinction between [`Critical`] and [`Informational`].
///
/// [`Critical`]: Self::Critical
/// [`Informational`]: Self::Informational
#[derive(Debug, Clone, Copy)]
pub enum UserAttention {
/// ## Platform-specific
///
/// - **macOS:** Bounces the dock icon until the application is in focus.
/// - **Windows:** Flashes both the window and the taskbar button until the application is in focus.
Critical,
/// ## Platform-specific
///
/// - **macOS:** Bounces the dock icon once.
/// - **Windows:** Flashes the taskbar button until the application is in focus.
Informational,
}