mirror of
https://github.com/weyne85/rustdesk.git
synced 2025-10-29 17:00:05 +00:00
wayland cursor embeded
Signed-off-by: fufesou <shuanglongchen@yeah.net>
This commit is contained in:
@@ -40,6 +40,7 @@ message DisplayInfo {
|
||||
int32 height = 4;
|
||||
string name = 5;
|
||||
bool online = 6;
|
||||
bool cursor_embeded = 7;
|
||||
}
|
||||
|
||||
message PortForward {
|
||||
@@ -419,6 +420,7 @@ message SwitchDisplay {
|
||||
sint32 y = 3;
|
||||
int32 width = 4;
|
||||
int32 height = 5;
|
||||
bool cursor_embeded = 6;
|
||||
}
|
||||
|
||||
message PermissionInfo {
|
||||
|
||||
@@ -69,3 +69,19 @@ pub trait TraitCapturer {
|
||||
pub fn is_x11() -> bool {
|
||||
"x11" == hbb_common::platform::linux::get_display_server()
|
||||
}
|
||||
|
||||
#[cfg(x11)]
|
||||
#[inline]
|
||||
pub fn is_cursor_embeded() -> bool {
|
||||
if is_x11() {
|
||||
x11::IS_CURSOR_EMBEDED
|
||||
} else {
|
||||
wayland::IS_CURSOR_EMBEDED
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(not(x11))]
|
||||
#[inline]
|
||||
pub fn is_cursor_embeded() -> bool {
|
||||
false
|
||||
}
|
||||
|
||||
@@ -4,6 +4,8 @@ use std::{io, sync::RwLock, time::Duration};
|
||||
|
||||
pub struct Capturer(Display, Box<dyn Recorder>, bool, Vec<u8>);
|
||||
|
||||
pub const IS_CURSOR_EMBEDED: bool = true;
|
||||
|
||||
lazy_static::lazy_static! {
|
||||
static ref MAP_ERR: RwLock<Option<fn(err: String)-> io::Error>> = Default::default();
|
||||
}
|
||||
@@ -66,7 +68,7 @@ impl Display {
|
||||
}
|
||||
|
||||
pub fn all() -> io::Result<Vec<Display>> {
|
||||
Ok(pipewire::get_capturables(false)
|
||||
Ok(pipewire::get_capturables(true)
|
||||
.map_err(map_err)?
|
||||
.drain(..)
|
||||
.map(|x| Display(x))
|
||||
|
||||
@@ -3,6 +3,8 @@ use std::{io, ops, time::Duration};
|
||||
|
||||
pub struct Capturer(x11::Capturer);
|
||||
|
||||
pub const IS_CURSOR_EMBEDED: bool = true;
|
||||
|
||||
impl Capturer {
|
||||
pub fn new(display: Display, yuv: bool) -> io::Result<Capturer> {
|
||||
x11::Capturer::new(display.0, yuv).map(Capturer)
|
||||
|
||||
Reference in New Issue
Block a user