diff --git a/src/capturer/engine/linux/mod.rs b/src/capturer/engine/linux/mod.rs index fc4d32e..17ab2e4 100644 --- a/src/capturer/engine/linux/mod.rs +++ b/src/capturer/engine/linux/mod.rs @@ -335,16 +335,7 @@ impl LinuxCapturer { .pw_node_id(); // TODO: Fix this hack - let options = Options { - fps: options.fps, - show_cursor: options.show_cursor, - show_highlight: options.show_highlight, - output_type: options.output_type, - targets: options.targets.clone(), - excluded_targets: None, - output_resolution: crate::capturer::Resolution::Captured, - source_rect: None, - }; + let options = options.clone(); let (ready_sender, ready_recv) = sync_channel(1); let capturer_join_handle = std::thread::spawn(move || { let res = pipewire_capturer(options, tx, &ready_sender, stream_id); @@ -375,6 +366,8 @@ impl LinuxCapturer { eprintln!("Error occured capturing: {e}"); } } + CAPTURER_STATE.store(0, std::sync::atomic::Ordering::Relaxed); + STREAM_STATE_CHANGED_TO_ERROR.store(false, std::sync::atomic::Ordering::Relaxed); } } diff --git a/src/capturer/engine/linux/portal.rs b/src/capturer/engine/linux/portal.rs index 97cde90..013d4dd 100644 --- a/src/capturer/engine/linux/portal.rs +++ b/src/capturer/engine/linux/portal.rs @@ -408,13 +408,14 @@ impl<'a> ScreenCastPortal<'a> { pub fn show_cursor(mut self, mode: bool) -> Result { let available_modes = self.proxy.available_cursor_modes()?; - if mode && available_modes & 1 == 1 { - self.cursor_mode = 1; - return Ok(self); - } else if !mode && available_modes & 2 == 1 { + if mode && available_modes & 2 == 2 { self.cursor_mode = 2; return Ok(self); } + if !mode && available_modes & 1 == 1 { + self.cursor_mode = 1; + return Ok(self); + } Err(LinCapError::new("Unsupported cursor mode".to_string())) } diff --git a/src/targets/mod.rs b/src/targets/mod.rs index 836bc7c..930ab62 100644 --- a/src/targets/mod.rs +++ b/src/targets/mod.rs @@ -57,7 +57,7 @@ pub fn get_scale_factor(target: &Target) -> f64 { return win::get_scale_factor(target); #[cfg(target_os = "linux")] - return 1; + return 1.0; } pub fn get_main_display() -> Display { @@ -67,8 +67,8 @@ pub fn get_main_display() -> Display { #[cfg(target_os = "windows")] return win::get_main_display(); - // #[cfg(target_os = "linux")] - // return linux::get_main_display(); + #[cfg(target_os = "linux")] + unreachable!(); } pub fn get_target_dimensions(target: &Target) -> (u64, u64) { @@ -78,6 +78,6 @@ pub fn get_target_dimensions(target: &Target) -> (u64, u64) { #[cfg(target_os = "windows")] return win::get_target_dimensions(target); - // #[cfg(target_os = "linux")] - // return linux::get_target_dimensions(target); + #[cfg(target_os = "linux")] + unreachable!(); }