Fixes for freedesktop_screensaver
This commit is contained in:
parent
e8feb4342c
commit
fbc21ca2a3
1 changed files with 4 additions and 1 deletions
|
|
@ -42,7 +42,7 @@ impl Screensaver {
|
|||
);
|
||||
let mut inhibitors = self.inhibitors.lock().unwrap();
|
||||
if inhibitors.is_empty() {
|
||||
let _ = self.event_sender.send(Event::ScreensaverInhibit(false));
|
||||
let _ = self.event_sender.send(Event::ScreensaverInhibit(true));
|
||||
}
|
||||
inhibitors.push(Inhibitor {
|
||||
cookie,
|
||||
|
|
@ -58,6 +58,9 @@ impl Screensaver {
|
|||
let mut inhibitors = self.inhibitors.lock().unwrap();
|
||||
if let Some(idx) = inhibitors.iter().position(|x| x.cookie == cookie) {
|
||||
let inhibitor = inhibitors.remove(idx);
|
||||
if inhibitors.is_empty() {
|
||||
let _ = self.event_sender.send(Event::ScreensaverInhibit(false));
|
||||
}
|
||||
log::info!(
|
||||
"Removed screensaver inhibitor for application '{}' {:?}, reason: {}, cookie: {}",
|
||||
inhibitor.application_name,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue