summaryrefslogtreecommitdiffstats
path: root/native/src/window/user_attention.rs
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón <hector0193@gmail.com>2023-01-02 20:32:43 +0100
committerLibravatar GitHub <noreply@github.com>2023-01-02 20:32:43 +0100
commitd956b8a9fb9d0f18c5568c91fc7b97900477a68e (patch)
treec2de1b39375037d9a54bb7f057f1197263b05dc0 /native/src/window/user_attention.rs
parent54105a24e11edb48670afa8246ad891af147aab5 (diff)
parent6855961358d6b81d700afd65445c292fd0da4442 (diff)
downloadiced-d956b8a9fb9d0f18c5568c91fc7b97900477a68e.tar.gz
iced-d956b8a9fb9d0f18c5568c91fc7b97900477a68e.tar.bz2
iced-d956b8a9fb9d0f18c5568c91fc7b97900477a68e.zip
Merge pull request #1584 from Night-Hunter-NF/RequestUserAttention
add action to request user attention
Diffstat (limited to 'native/src/window/user_attention.rs')
-rw-r--r--native/src/window/user_attention.rs21
1 files changed, 21 insertions, 0 deletions
diff --git a/native/src/window/user_attention.rs b/native/src/window/user_attention.rs
new file mode 100644
index 00000000..b03dfeef
--- /dev/null
+++ b/native/src/window/user_attention.rs
@@ -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,
+}