diff options
| author | Ivan Molodetskikh <yalterz@gmail.com> | 2024-11-23 15:05:27 +0300 |
|---|---|---|
| committer | Ivan Molodetskikh <yalterz@gmail.com> | 2024-11-23 15:07:09 +0300 |
| commit | 38c515e12e51a5af381af75be734fa31c6cab711 (patch) | |
| tree | ee6450913916e6d6f161e501b8f3daf53bc7ec28 /src | |
| parent | c239937fac836f308311eff5f5d5fc5262c6eb55 (diff) | |
| download | niri-38c515e12e51a5af381af75be734fa31c6cab711.tar.gz niri-38c515e12e51a5af381af75be734fa31c6cab711.tar.bz2 niri-38c515e12e51a5af381af75be734fa31c6cab711.zip | |
pw: Fix potential crash when disconnecting output
Diffstat (limited to 'src')
| -rw-r--r-- | src/pw_utils.rs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/pw_utils.rs b/src/pw_utils.rs index d7524d20..a68ba9fe 100644 --- a/src/pw_utils.rs +++ b/src/pw_utils.rs @@ -769,7 +769,11 @@ impl Cast { let timer = Timer::from_duration(duration); let token = event_loop .insert_source(timer, move |_, _, state| { - state.niri.queue_redraw(&output); + // Guard against output disconnecting before the timer has a chance to run. + if state.niri.output_state.contains_key(&output) { + state.niri.queue_redraw(&output); + } + TimeoutAction::Drop }) .unwrap(); |
