Lock session on screen blanking
This commit is contained in:
parent
a45b68f0cf
commit
7a20c88896
2 changed files with 15 additions and 0 deletions
|
|
@ -137,6 +137,11 @@ impl Dispatch<wl_callback::WlCallback, wl_surface::WlSurface> for State {
|
|||
.output_power
|
||||
.set_mode(zwlr_output_power_v1::Mode::Off);
|
||||
output.fade_surface = None;
|
||||
|
||||
// All outputs are done fading
|
||||
if state.outputs.iter().all(|o| o.fade_surface.is_none()) {
|
||||
state.fade_done();
|
||||
}
|
||||
} else {
|
||||
fade_surface.update(&state.inner);
|
||||
}
|
||||
|
|
|
|||
10
src/main.rs
10
src/main.rs
|
|
@ -148,6 +148,16 @@ impl State {
|
|||
}
|
||||
}
|
||||
|
||||
// Fade surfaces on all outputs have finished fading out
|
||||
fn fade_done(&mut self) {
|
||||
if let Some(command) = self
|
||||
.system_actions
|
||||
.get(&shortcuts::action::System::LockScreen)
|
||||
{
|
||||
crate::run_command(command.to_string());
|
||||
}
|
||||
}
|
||||
|
||||
fn update_suspend_idle(&mut self, is_idle: bool) {
|
||||
if is_idle {
|
||||
// TODO: Make command configurable
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue