Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
richiemcilroy committed Jul 31, 2024
2 parents f95799d + ac7c50b commit fedca13
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 19 deletions.
13 changes: 3 additions & 10 deletions src/capturer/engine/linux/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
}
}

Expand Down
9 changes: 5 additions & 4 deletions src/capturer/engine/linux/portal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -408,13 +408,14 @@ impl<'a> ScreenCastPortal<'a> {

pub fn show_cursor(mut self, mode: bool) -> Result<Self, LinCapError> {
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()))
}
Expand Down
10 changes: 5 additions & 5 deletions src/targets/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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) {
Expand All @@ -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!();
}

0 comments on commit fedca13

Please sign in to comment.