diff options
| author | Ivan Molodetskikh <yalterz@gmail.com> | 2024-03-19 08:59:28 +0400 |
|---|---|---|
| committer | Ivan Molodetskikh <yalterz@gmail.com> | 2024-03-19 08:59:28 +0400 |
| commit | e0da101c73f1c6e7728632f43d2e49e19b8787b2 (patch) | |
| tree | 74abbfef3b76d526c1ac238a47b7dfafef536985 | |
| parent | 4740682904f7353f5969449f3f63afc6c787c7c1 (diff) | |
| download | niri-e0da101c73f1c6e7728632f43d2e49e19b8787b2.tar.gz niri-e0da101c73f1c6e7728632f43d2e49e19b8787b2.tar.bz2 niri-e0da101c73f1c6e7728632f43d2e49e19b8787b2.zip | |
Disable screencast when PipeWire is missing
This can cause a panic.
| -rw-r--r-- | src/dbus/mod.rs | 4 | ||||
| -rw-r--r-- | src/niri.rs | 6 |
2 files changed, 8 insertions, 2 deletions
diff --git a/src/dbus/mod.rs b/src/dbus/mod.rs index 75d6da16..6d8b81e6 100644 --- a/src/dbus/mod.rs +++ b/src/dbus/mod.rs @@ -67,7 +67,7 @@ impl DBusServers { dbus.conn_screen_shot = try_start(screenshot); #[cfg(feature = "xdp-gnome-screencast")] - { + if niri.pipewire.is_some() { let (to_niri, from_screen_cast) = calloop::channel::channel(); niri.event_loop .insert_source(from_screen_cast, { @@ -82,6 +82,8 @@ impl DBusServers { .unwrap(); let screen_cast = ScreenCast::new(backend.enabled_outputs(), to_niri); dbus.conn_screen_cast = try_start(screen_cast); + } else { + warn!("disabling screencast support because we couldn't start PipeWire"); } } diff --git a/src/niri.rs b/src/niri.rs index f63f05a3..b87ce915 100644 --- a/src/niri.rs +++ b/src/niri.rs @@ -898,7 +898,11 @@ impl State { } }; - let pw = self.niri.pipewire.as_ref().unwrap(); + let Some(pw) = &self.niri.pipewire else { + error!("screencasting must be disabled if PipeWire is missing"); + return; + }; + match pw.start_cast( to_niri.clone(), gbm, |
