Do not inhibit suspend when lock screen already shown, fixes #230

This commit is contained in:
Jeremy Soller 2025-07-08 10:00:32 -06:00
parent 6ea0f9868a
commit 38e6b93d57
No known key found for this signature in database
GPG key ID: 670FDFB5428E05CA

View file

@ -881,9 +881,14 @@ impl cosmic::Application for App {
self.dropdown_opt = Some(dropdown);
}
}
Message::Inhibit(inhibit) => {
self.inhibit_opt = Some(inhibit);
}
Message::Inhibit(inhibit) => match self.state {
State::Locked { .. } => {
log::info!("no need to inhibit sleep when already locked");
}
_ => {
self.inhibit_opt = Some(inhibit);
}
},
Message::KeyboardLayout(layout_i) => {
if layout_i < self.common.active_layouts.len() {
self.common.active_layouts.swap(0, layout_i);