From 5cd3af4dc94b12443869c7086e44c29b54967be2 Mon Sep 17 00:00:00 2001 From: Demmie <2e3s19@gmail.com> Date: Wed, 26 Apr 2023 02:06:26 -0400 Subject: [PATCH] Fix error for gnome lock screen --- src/watchers/gnome_window.rs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/watchers/gnome_window.rs b/src/watchers/gnome_window.rs index 1fa78b9..ef7d771 100644 --- a/src/watchers/gnome_window.rs +++ b/src/watchers/gnome_window.rs @@ -39,6 +39,7 @@ impl WindowWatcher { } Err(e) => { if e.to_string().contains("No window in focus") { + trace!("No window is active"); Ok(WindowData::default()) } else { Err(e.into()) @@ -48,7 +49,15 @@ impl WindowWatcher { } fn send_active_window(&mut self, client: &ReportClient) -> anyhow::Result<()> { - let data = self.get_window_data()?; + let data = self.get_window_data(); + if let Err(e) = data { + if e.to_string().contains("Object does not exist at path") { + trace!("The extension seems to have stopped"); + return Ok(()); + } + return Err(e); + } + let data = data?; if data.wm_class != self.last_app_id || data.title != self.last_title { debug!(