From 4d50adcfb29e7ee3fb66769e82f5beaf65db2532 Mon Sep 17 00:00:00 2001 From: Vika Date: Fri, 3 Jan 2025 14:52:47 +0300 Subject: Allow idle time detection on all Wayland desktops Other desktops require C dependencies I don't want to bring in, so let's leave it at that. Pretty much all of the code was kanged from the new Iced rewrite. --- src/ui/window.rs | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) (limited to 'src/ui/window.rs') diff --git a/src/ui/window.rs b/src/ui/window.rs index bf23729..7fd4450 100644 --- a/src/ui/window.rs +++ b/src/ui/window.rs @@ -583,17 +583,7 @@ impl FurtheranceWindow { } fn get_idle_time(&self) -> Result> { - let c = Connection::new_session()?; - - let p = c.with_proxy( - "org.gnome.Mutter.IdleMonitor", - "/org/gnome/Mutter/IdleMonitor/Core", - Duration::from_millis(5000), - ); - let (idle_time,): (u64,) = - p.method_call("org.gnome.Mutter.IdleMonitor", "GetIdletime", ())?; - - Ok(idle_time / 1000) + crate::helpers::get_idle_time() } fn check_user_idle(&self) { -- cgit 1.4.1