mirror of
https://github.com/2e3s/awatcher.git
synced 2025-06-05 19:15:33 +00:00
Fix error for gnome lock screen
This commit is contained in:
parent
add5b4644e
commit
5cd3af4dc9
@ -39,6 +39,7 @@ impl WindowWatcher {
|
|||||||
}
|
}
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
if e.to_string().contains("No window in focus") {
|
if e.to_string().contains("No window in focus") {
|
||||||
|
trace!("No window is active");
|
||||||
Ok(WindowData::default())
|
Ok(WindowData::default())
|
||||||
} else {
|
} else {
|
||||||
Err(e.into())
|
Err(e.into())
|
||||||
@ -48,7 +49,15 @@ impl WindowWatcher {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn send_active_window(&mut self, client: &ReportClient) -> anyhow::Result<()> {
|
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 {
|
if data.wm_class != self.last_app_id || data.title != self.last_title {
|
||||||
debug!(
|
debug!(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user