Rename ToNiriMsg to ScreenCastToNiri
Browse files at this commitd66bd87c66d7942037a74a8298716322ebe22adfParent: a0b8da63 changed files +18 -18
- src/dbus/mutter_screen_cast.rs +10 -10
- src/niri.rs +5 -5
- src/pw_utils.rs +3 -3
src/dbus/mutter_screen_cast.rsmodified+10 -10
| @@ -12,7 +12,7 @@ use zbus::{dbus_interface, fdo, InterfaceRef, ObjectServer, SignalContext}; | |||
| 12 | #[derive(Clone)] | 12 | #[derive(Clone)] |
| 13 | pub struct ScreenCast { | 13 | pub struct ScreenCast { |
| 14 | connectors: Arc<Mutex<HashMap<String, Output>>>, | 14 | connectors: Arc<Mutex<HashMap<String, Output>>>, |
| 15 | - to_niri: calloop::channel::Sender<ToNiriMsg>, | 15 | + to_niri: calloop::channel::Sender<ScreenCastToNiri>, |
| 16 | sessions: Arc<Mutex<Vec<(Session, InterfaceRef<Session>)>>>, | 16 | sessions: Arc<Mutex<Vec<(Session, InterfaceRef<Session>)>>>, |
| 17 | } | 17 | } |
| 18 | 18 | ||
| @@ -20,7 +20,7 @@ pub struct ScreenCast { | |||
| 20 | pub struct Session { | 20 | pub struct Session { |
| 21 | id: usize, | 21 | id: usize, |
| 22 | connectors: Arc<Mutex<HashMap<String, Output>>>, | 22 | connectors: Arc<Mutex<HashMap<String, Output>>>, |
| 23 | - to_niri: calloop::channel::Sender<ToNiriMsg>, | 23 | + to_niri: calloop::channel::Sender<ScreenCastToNiri>, |
| 24 | streams: Arc<Mutex<Vec<(Stream, InterfaceRef<Stream>)>>>, | 24 | streams: Arc<Mutex<Vec<(Stream, InterfaceRef<Stream>)>>>, |
| 25 | } | 25 | } |
| 26 | 26 | ||
| @@ -46,10 +46,10 @@ pub struct Stream { | |||
| 46 | output: Output, | 46 | output: Output, |
| 47 | cursor_mode: CursorMode, | 47 | cursor_mode: CursorMode, |
| 48 | was_started: Arc<AtomicBool>, | 48 | was_started: Arc<AtomicBool>, |
| 49 | - to_niri: calloop::channel::Sender<ToNiriMsg>, | 49 | + to_niri: calloop::channel::Sender<ScreenCastToNiri>, |
| 50 | } | 50 | } |
| 51 | 51 | ||
| 52 | -pub enum ToNiriMsg { | 52 | +pub enum ScreenCastToNiri { |
| 53 | StartCast { | 53 | StartCast { |
| 54 | session_id: usize, | 54 | session_id: usize, |
| 55 | output: Output, | 55 | output: Output, |
| @@ -121,7 +121,7 @@ impl Session { | |||
| 121 | 121 | ||
| 122 | Session::closed(&ctxt).await.unwrap(); | 122 | Session::closed(&ctxt).await.unwrap(); |
| 123 | 123 | ||
| 124 | - if let Err(err) = self.to_niri.send(ToNiriMsg::StopCast { | 124 | + if let Err(err) = self.to_niri.send(ScreenCastToNiri::StopCast { |
| 125 | session_id: self.id, | 125 | session_id: self.id, |
| 126 | }) { | 126 | }) { |
| 127 | warn!("error sending StopCast to niri: {err:?}"); | 127 | warn!("error sending StopCast to niri: {err:?}"); |
| @@ -190,7 +190,7 @@ impl Stream { | |||
| 190 | impl ScreenCast { | 190 | impl ScreenCast { |
| 191 | pub fn new( | 191 | pub fn new( |
| 192 | connectors: Arc<Mutex<HashMap<String, Output>>>, | 192 | connectors: Arc<Mutex<HashMap<String, Output>>>, |
| 193 | - to_niri: calloop::channel::Sender<ToNiriMsg>, | 193 | + to_niri: calloop::channel::Sender<ScreenCastToNiri>, |
| 194 | ) -> Self { | 194 | ) -> Self { |
| 195 | Self { | 195 | Self { |
| 196 | connectors, | 196 | connectors, |
| @@ -204,7 +204,7 @@ impl Session { | |||
| 204 | pub fn new( | 204 | pub fn new( |
| 205 | id: usize, | 205 | id: usize, |
| 206 | connectors: Arc<Mutex<HashMap<String, Output>>>, | 206 | connectors: Arc<Mutex<HashMap<String, Output>>>, |
| 207 | - to_niri: calloop::channel::Sender<ToNiriMsg>, | 207 | + to_niri: calloop::channel::Sender<ScreenCastToNiri>, |
| 208 | ) -> Self { | 208 | ) -> Self { |
| 209 | Self { | 209 | Self { |
| 210 | id, | 210 | id, |
| @@ -217,7 +217,7 @@ impl Session { | |||
| 217 | 217 | ||
| 218 | impl Drop for Session { | 218 | impl Drop for Session { |
| 219 | fn drop(&mut self) { | 219 | fn drop(&mut self) { |
| 220 | - let _ = self.to_niri.send(ToNiriMsg::StopCast { | 220 | + let _ = self.to_niri.send(ScreenCastToNiri::StopCast { |
| 221 | session_id: self.id, | 221 | session_id: self.id, |
| 222 | }); | 222 | }); |
| 223 | } | 223 | } |
| @@ -227,7 +227,7 @@ impl Stream { | |||
| 227 | pub fn new( | 227 | pub fn new( |
| 228 | output: Output, | 228 | output: Output, |
| 229 | cursor_mode: CursorMode, | 229 | cursor_mode: CursorMode, |
| 230 | - to_niri: calloop::channel::Sender<ToNiriMsg>, | 230 | + to_niri: calloop::channel::Sender<ScreenCastToNiri>, |
| 231 | ) -> Self { | 231 | ) -> Self { |
| 232 | Self { | 232 | Self { |
| 233 | output, | 233 | output, |
| @@ -242,7 +242,7 @@ impl Stream { | |||
| 242 | return; | 242 | return; |
| 243 | } | 243 | } |
| 244 | 244 | ||
| 245 | - let msg = ToNiriMsg::StartCast { | 245 | + let msg = ScreenCastToNiri::StartCast { |
| 246 | session_id, | 246 | session_id, |
| 247 | output: self.output.clone(), | 247 | output: self.output.clone(), |
| 248 | cursor_mode: self.cursor_mode, | 248 | cursor_mode: self.cursor_mode, |
src/niri.rsmodified+5 -5
| @@ -78,7 +78,7 @@ use crate::cursor::Cursor; | |||
| 78 | use crate::dbus::gnome_shell_screenshot::{self, NiriToScreenshot, ScreenshotToNiri}; | 78 | use crate::dbus::gnome_shell_screenshot::{self, NiriToScreenshot, ScreenshotToNiri}; |
| 79 | use crate::dbus::mutter_display_config::DisplayConfig; | 79 | use crate::dbus::mutter_display_config::DisplayConfig; |
| 80 | #[cfg(feature = "xdp-gnome-screencast")] | 80 | #[cfg(feature = "xdp-gnome-screencast")] |
| 81 | -use crate::dbus::mutter_screen_cast::{self, ScreenCast, ToNiriMsg}; | 81 | +use crate::dbus::mutter_screen_cast::{self, ScreenCast, ScreenCastToNiri}; |
| 82 | use crate::dbus::mutter_service_channel::ServiceChannel; | 82 | use crate::dbus::mutter_service_channel::ServiceChannel; |
| 83 | use crate::frame_clock::FrameClock; | 83 | use crate::frame_clock::FrameClock; |
| 84 | use crate::layout::{output_size, Layout, MonitorRenderElement}; | 84 | use crate::layout::{output_size, Layout, MonitorRenderElement}; |
| @@ -310,11 +310,11 @@ impl State { | |||
| 310 | #[cfg(feature = "xdp-gnome-screencast")] | 310 | #[cfg(feature = "xdp-gnome-screencast")] |
| 311 | fn on_screen_cast_msg( | 311 | fn on_screen_cast_msg( |
| 312 | &mut self, | 312 | &mut self, |
| 313 | - to_niri: &calloop::channel::Sender<ToNiriMsg>, | 313 | + to_niri: &calloop::channel::Sender<ScreenCastToNiri>, |
| 314 | - msg: ToNiriMsg, | 314 | + msg: ScreenCastToNiri, |
| 315 | ) { | 315 | ) { |
| 316 | match msg { | 316 | match msg { |
| 317 | - ToNiriMsg::StartCast { | 317 | + ScreenCastToNiri::StartCast { |
| 318 | session_id, | 318 | session_id, |
| 319 | output, | 319 | output, |
| 320 | cursor_mode, | 320 | cursor_mode, |
| @@ -350,7 +350,7 @@ impl State { | |||
| 350 | } | 350 | } |
| 351 | } | 351 | } |
| 352 | } | 352 | } |
| 353 | - ToNiriMsg::StopCast { session_id } => self.niri.stop_cast(session_id), | 353 | + ScreenCastToNiri::StopCast { session_id } => self.niri.stop_cast(session_id), |
| 354 | } | 354 | } |
| 355 | } | 355 | } |
| 356 | 356 | ||
src/pw_utils.rsmodified+3 -3
| @@ -29,7 +29,7 @@ use smithay::reexports::calloop::{self, Interest, LoopHandle, Mode, PostAction}; | |||
| 29 | use smithay::reexports::gbm::Modifier; | 29 | use smithay::reexports::gbm::Modifier; |
| 30 | use zbus::SignalContext; | 30 | use zbus::SignalContext; |
| 31 | 31 | ||
| 32 | -use crate::dbus::mutter_screen_cast::{self, CursorMode, ToNiriMsg}; | 32 | +use crate::dbus::mutter_screen_cast::{self, CursorMode, ScreenCastToNiri}; |
| 33 | use crate::niri::State; | 33 | use crate::niri::State; |
| 34 | 34 | ||
| 35 | pub struct PipeWire { | 35 | pub struct PipeWire { |
| @@ -86,7 +86,7 @@ impl PipeWire { | |||
| 86 | 86 | ||
| 87 | pub fn start_cast( | 87 | pub fn start_cast( |
| 88 | &self, | 88 | &self, |
| 89 | - to_niri: calloop::channel::Sender<ToNiriMsg>, | 89 | + to_niri: calloop::channel::Sender<ScreenCastToNiri>, |
| 90 | gbm: GbmDevice<DrmDeviceFd>, | 90 | gbm: GbmDevice<DrmDeviceFd>, |
| 91 | session_id: usize, | 91 | session_id: usize, |
| 92 | output: Output, | 92 | output: Output, |
| @@ -96,7 +96,7 @@ impl PipeWire { | |||
| 96 | let _span = tracy_client::span!("PipeWire::start_cast"); | 96 | let _span = tracy_client::span!("PipeWire::start_cast"); |
| 97 | 97 | ||
| 98 | let stop_cast = move || { | 98 | let stop_cast = move || { |
| 99 | - if let Err(err) = to_niri.send(ToNiriMsg::StopCast { session_id }) { | 99 | + if let Err(err) = to_niri.send(ScreenCastToNiri::StopCast { session_id }) { |
| 100 | warn!("error sending StopCast to niri: {err:?}"); | 100 | warn!("error sending StopCast to niri: {err:?}"); |
| 101 | } | 101 | } |
| 102 | }; | 102 | }; |