mirror of
https://github.com/rustdesk/rustdesk.git
synced 2024-11-27 14:59:02 +08:00
not run window focus service on wayland (#9354)
Signed-off-by: 21pages <sunboeasy@gmail.com>
This commit is contained in:
parent
81fc22a156
commit
40af9dc78b
@ -1,3 +1,4 @@
|
||||
use hbb_common::libc;
|
||||
use std::ptr;
|
||||
use std::rc::Rc;
|
||||
|
||||
@ -99,11 +100,16 @@ unsafe fn check_x11_shm_available(c: *mut xcb_connection_t) -> Result<(), Error>
|
||||
if reply.is_null() {
|
||||
// TODO: Should seperate SHM disabled from SHM not supported?
|
||||
return Err(Error::UnsupportedExtension);
|
||||
} else if e.is_null() {
|
||||
return Ok(());
|
||||
} else {
|
||||
// TODO: Does "This request does never generate any errors" in manual means `e` is never set, so we would never reach here?
|
||||
return Err(Error::Generic);
|
||||
// https://github.com/FFmpeg/FFmpeg/blob/6229e4ac425b4566446edefb67d5c225eb397b58/libavdevice/xcbgrab.c#L229
|
||||
libc::free(reply as *mut _);
|
||||
if e.is_null() {
|
||||
return Ok(());
|
||||
} else {
|
||||
libc::free(e as *mut _);
|
||||
// TODO: Does "This request does never generate any errors" in manual means `e` is never set, so we would never reach here?
|
||||
return Err(Error::Generic);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -106,7 +106,10 @@ pub fn new() -> ServerPtr {
|
||||
if !display_service::capture_cursor_embedded() {
|
||||
server.add_service(Box::new(input_service::new_cursor()));
|
||||
server.add_service(Box::new(input_service::new_pos()));
|
||||
server.add_service(Box::new(input_service::new_window_focus()));
|
||||
if scrap::is_x11() {
|
||||
// wayland does not support multiple displays currently
|
||||
server.add_service(Box::new(input_service::new_window_focus()));
|
||||
}
|
||||
}
|
||||
}
|
||||
Arc::new(RwLock::new(server))
|
||||
|
Loading…
Reference in New Issue
Block a user