Skip to content

Commit 7734b7f

Browse files
authored
Merge pull request #96 from MAlba124/linux-cursor-fix
linux: fix cursor mode logic error
2 parents 0e75ae8 + 1a01599 commit 7734b7f

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/capturer/engine/linux/portal.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -408,13 +408,14 @@ impl<'a> ScreenCastPortal<'a> {
408408

409409
pub fn show_cursor(mut self, mode: bool) -> Result<Self, LinCapError> {
410410
let available_modes = self.proxy.available_cursor_modes()?;
411-
if mode && available_modes & 1 == 1 {
412-
self.cursor_mode = 1;
413-
return Ok(self);
414-
} else if !mode && available_modes & 2 == 1 {
411+
if mode && available_modes & 2 == 2 {
415412
self.cursor_mode = 2;
416413
return Ok(self);
417414
}
415+
if !mode && available_modes & 1 == 1 {
416+
self.cursor_mode = 1;
417+
return Ok(self);
418+
}
418419

419420
Err(LinCapError::new("Unsupported cursor mode".to_string()))
420421
}

0 commit comments

Comments
 (0)