mirror of
https://github.com/niri-wm/niri.git
synced 2026-06-22 02:01:55 +07:00
Rename ToNiriMsg to ScreenCastToNiri
This commit is contained in:
@@ -12,7 +12,7 @@ use zbus::{dbus_interface, fdo, InterfaceRef, ObjectServer, SignalContext};
|
||||
#[derive(Clone)]
|
||||
pub struct ScreenCast {
|
||||
connectors: Arc<Mutex<HashMap<String, Output>>>,
|
||||
to_niri: calloop::channel::Sender<ToNiriMsg>,
|
||||
to_niri: calloop::channel::Sender<ScreenCastToNiri>,
|
||||
sessions: Arc<Mutex<Vec<(Session, InterfaceRef<Session>)>>>,
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ pub struct ScreenCast {
|
||||
pub struct Session {
|
||||
id: usize,
|
||||
connectors: Arc<Mutex<HashMap<String, Output>>>,
|
||||
to_niri: calloop::channel::Sender<ToNiriMsg>,
|
||||
to_niri: calloop::channel::Sender<ScreenCastToNiri>,
|
||||
streams: Arc<Mutex<Vec<(Stream, InterfaceRef<Stream>)>>>,
|
||||
}
|
||||
|
||||
@@ -46,10 +46,10 @@ pub struct Stream {
|
||||
output: Output,
|
||||
cursor_mode: CursorMode,
|
||||
was_started: Arc<AtomicBool>,
|
||||
to_niri: calloop::channel::Sender<ToNiriMsg>,
|
||||
to_niri: calloop::channel::Sender<ScreenCastToNiri>,
|
||||
}
|
||||
|
||||
pub enum ToNiriMsg {
|
||||
pub enum ScreenCastToNiri {
|
||||
StartCast {
|
||||
session_id: usize,
|
||||
output: Output,
|
||||
@@ -121,7 +121,7 @@ impl Session {
|
||||
|
||||
Session::closed(&ctxt).await.unwrap();
|
||||
|
||||
if let Err(err) = self.to_niri.send(ToNiriMsg::StopCast {
|
||||
if let Err(err) = self.to_niri.send(ScreenCastToNiri::StopCast {
|
||||
session_id: self.id,
|
||||
}) {
|
||||
warn!("error sending StopCast to niri: {err:?}");
|
||||
@@ -190,7 +190,7 @@ impl Stream {
|
||||
impl ScreenCast {
|
||||
pub fn new(
|
||||
connectors: Arc<Mutex<HashMap<String, Output>>>,
|
||||
to_niri: calloop::channel::Sender<ToNiriMsg>,
|
||||
to_niri: calloop::channel::Sender<ScreenCastToNiri>,
|
||||
) -> Self {
|
||||
Self {
|
||||
connectors,
|
||||
@@ -204,7 +204,7 @@ impl Session {
|
||||
pub fn new(
|
||||
id: usize,
|
||||
connectors: Arc<Mutex<HashMap<String, Output>>>,
|
||||
to_niri: calloop::channel::Sender<ToNiriMsg>,
|
||||
to_niri: calloop::channel::Sender<ScreenCastToNiri>,
|
||||
) -> Self {
|
||||
Self {
|
||||
id,
|
||||
@@ -217,7 +217,7 @@ impl Session {
|
||||
|
||||
impl Drop for Session {
|
||||
fn drop(&mut self) {
|
||||
let _ = self.to_niri.send(ToNiriMsg::StopCast {
|
||||
let _ = self.to_niri.send(ScreenCastToNiri::StopCast {
|
||||
session_id: self.id,
|
||||
});
|
||||
}
|
||||
@@ -227,7 +227,7 @@ impl Stream {
|
||||
pub fn new(
|
||||
output: Output,
|
||||
cursor_mode: CursorMode,
|
||||
to_niri: calloop::channel::Sender<ToNiriMsg>,
|
||||
to_niri: calloop::channel::Sender<ScreenCastToNiri>,
|
||||
) -> Self {
|
||||
Self {
|
||||
output,
|
||||
@@ -242,7 +242,7 @@ impl Stream {
|
||||
return;
|
||||
}
|
||||
|
||||
let msg = ToNiriMsg::StartCast {
|
||||
let msg = ScreenCastToNiri::StartCast {
|
||||
session_id,
|
||||
output: self.output.clone(),
|
||||
cursor_mode: self.cursor_mode,
|
||||
|
||||
+5
-5
@@ -78,7 +78,7 @@ use crate::cursor::Cursor;
|
||||
use crate::dbus::gnome_shell_screenshot::{self, NiriToScreenshot, ScreenshotToNiri};
|
||||
use crate::dbus::mutter_display_config::DisplayConfig;
|
||||
#[cfg(feature = "xdp-gnome-screencast")]
|
||||
use crate::dbus::mutter_screen_cast::{self, ScreenCast, ToNiriMsg};
|
||||
use crate::dbus::mutter_screen_cast::{self, ScreenCast, ScreenCastToNiri};
|
||||
use crate::dbus::mutter_service_channel::ServiceChannel;
|
||||
use crate::frame_clock::FrameClock;
|
||||
use crate::layout::{output_size, Layout, MonitorRenderElement};
|
||||
@@ -310,11 +310,11 @@ impl State {
|
||||
#[cfg(feature = "xdp-gnome-screencast")]
|
||||
fn on_screen_cast_msg(
|
||||
&mut self,
|
||||
to_niri: &calloop::channel::Sender<ToNiriMsg>,
|
||||
msg: ToNiriMsg,
|
||||
to_niri: &calloop::channel::Sender<ScreenCastToNiri>,
|
||||
msg: ScreenCastToNiri,
|
||||
) {
|
||||
match msg {
|
||||
ToNiriMsg::StartCast {
|
||||
ScreenCastToNiri::StartCast {
|
||||
session_id,
|
||||
output,
|
||||
cursor_mode,
|
||||
@@ -350,7 +350,7 @@ impl State {
|
||||
}
|
||||
}
|
||||
}
|
||||
ToNiriMsg::StopCast { session_id } => self.niri.stop_cast(session_id),
|
||||
ScreenCastToNiri::StopCast { session_id } => self.niri.stop_cast(session_id),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+3
-3
@@ -29,7 +29,7 @@ use smithay::reexports::calloop::{self, Interest, LoopHandle, Mode, PostAction};
|
||||
use smithay::reexports::gbm::Modifier;
|
||||
use zbus::SignalContext;
|
||||
|
||||
use crate::dbus::mutter_screen_cast::{self, CursorMode, ToNiriMsg};
|
||||
use crate::dbus::mutter_screen_cast::{self, CursorMode, ScreenCastToNiri};
|
||||
use crate::niri::State;
|
||||
|
||||
pub struct PipeWire {
|
||||
@@ -86,7 +86,7 @@ impl PipeWire {
|
||||
|
||||
pub fn start_cast(
|
||||
&self,
|
||||
to_niri: calloop::channel::Sender<ToNiriMsg>,
|
||||
to_niri: calloop::channel::Sender<ScreenCastToNiri>,
|
||||
gbm: GbmDevice<DrmDeviceFd>,
|
||||
session_id: usize,
|
||||
output: Output,
|
||||
@@ -96,7 +96,7 @@ impl PipeWire {
|
||||
let _span = tracy_client::span!("PipeWire::start_cast");
|
||||
|
||||
let stop_cast = move || {
|
||||
if let Err(err) = to_niri.send(ToNiriMsg::StopCast { session_id }) {
|
||||
if let Err(err) = to_niri.send(ScreenCastToNiri::StopCast { session_id }) {
|
||||
warn!("error sending StopCast to niri: {err:?}");
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user