summaryrefslogtreecommitdiffstats
path: root/native/src/window/user_attention.rs
diff options
context:
space:
mode:
authorLibravatar Night_Hunter <samuelhuntnz@gmail.com>2022-12-10 01:53:00 +1300
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2023-01-02 20:13:42 +0100
commitd95b9bf244b5c1f7c8c3e84c1c05a5f81c9162e4 (patch)
tree3d0234ad5bebdf8a748e998484c2e3191e9e1216 /native/src/window/user_attention.rs
parent54105a24e11edb48670afa8246ad891af147aab5 (diff)
downloadiced-d95b9bf244b5c1f7c8c3e84c1c05a5f81c9162e4.tar.gz
iced-d95b9bf244b5c1f7c8c3e84c1c05a5f81c9162e4.tar.bz2
iced-d95b9bf244b5c1f7c8c3e84c1c05a5f81c9162e4.zip
Add `RequestUserAttention` to `window::Action`
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,
+}