aboutsummaryrefslogtreecommitdiff
path: root/src/window
diff options
context:
space:
mode:
Diffstat (limited to 'src/window')
-rw-r--r--src/window/mapped.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/window/mapped.rs b/src/window/mapped.rs
index 238f77a0..6481e9b8 100644
--- a/src/window/mapped.rs
+++ b/src/window/mapped.rs
@@ -183,6 +183,9 @@ pub struct Mapped {
/// These have been "sent" to the window in form of configures, but the window hadn't committed
/// in response yet.
uncommitted_maximized: Vec<(Serial, bool)>,
+
+ /// Most recent monotonic time when the window had the focus.
+ focus_timestamp: Option<Duration>,
}
niri_render_elements! {
@@ -279,6 +282,7 @@ impl Mapped {
is_maximized: false,
is_pending_maximized: false,
uncommitted_maximized: Vec::new(),
+ focus_timestamp: None,
};
rv.is_maximized = rv.sizing_mode().is_maximized();
@@ -515,6 +519,14 @@ impl Mapped {
})
}
+ pub fn get_focus_timestamp(&self) -> Option<Duration> {
+ self.focus_timestamp
+ }
+
+ pub fn set_focus_timestamp(&mut self, timestamp: Duration) {
+ self.focus_timestamp.replace(timestamp);
+ }
+
pub fn send_frame<T, F>(
&mut self,
output: &Output,