Merge pull request #3718 from fufesou/refact/wayland_cursor_not_embedded
do not embed cursor on wayland
This commit is contained in:
commit
ebbf2f2bba
@ -22,8 +22,9 @@ pub fn is_cursor_embedded() -> bool {
|
|||||||
unsafe fn init_cursor_embedded() {
|
unsafe fn init_cursor_embedded() {
|
||||||
use crate::common::wayland::pipewire::get_available_cursor_modes;
|
use crate::common::wayland::pipewire::get_available_cursor_modes;
|
||||||
match get_available_cursor_modes() {
|
match get_available_cursor_modes() {
|
||||||
Ok(modes) => {
|
Ok(_modes) => {
|
||||||
IS_CURSOR_EMBEDDED = Some((modes & 0x02) > 0);
|
// IS_CURSOR_EMBEDDED = Some((_modes & 0x02) > 0);
|
||||||
|
IS_CURSOR_EMBEDDED = Some(false)
|
||||||
}
|
}
|
||||||
Err(..) => {
|
Err(..) => {
|
||||||
IS_CURSOR_EMBEDDED = Some(false);
|
IS_CURSOR_EMBEDDED = Some(false);
|
||||||
|
@ -416,6 +416,12 @@ static mut INIT: bool = false;
|
|||||||
const RESTORE_TOKEN: &str = "restore_token";
|
const RESTORE_TOKEN: &str = "restore_token";
|
||||||
const RESTORE_TOKEN_CONF_KEY: &str = "wayland-restore-token";
|
const RESTORE_TOKEN_CONF_KEY: &str = "wayland-restore-token";
|
||||||
|
|
||||||
|
const PORTAL_CURSOR_MODE_HIDDEN: u32 = 1;
|
||||||
|
#[allow(dead_code)]
|
||||||
|
const PORTAL_CURSOR_MODE_EMBEDDED: u32 = 2;
|
||||||
|
#[allow(dead_code)]
|
||||||
|
const PORTAL_CURSOR_MODE_METADATA: u32 = 4;
|
||||||
|
|
||||||
pub fn get_available_cursor_modes() -> Result<u32, dbus::Error> {
|
pub fn get_available_cursor_modes() -> Result<u32, dbus::Error> {
|
||||||
let conn = SyncConnection::new_session()?;
|
let conn = SyncConnection::new_session()?;
|
||||||
let portal = get_portal(&conn);
|
let portal = get_portal(&conn);
|
||||||
@ -485,11 +491,11 @@ fn request_screen_cast(
|
|||||||
if let Ok(modes) = portal.available_cursor_modes() {
|
if let Ok(modes) = portal.available_cursor_modes() {
|
||||||
available_cursor_modes = modes;
|
available_cursor_modes = modes;
|
||||||
}
|
}
|
||||||
if capture_cursor {
|
// if capture_cursor {
|
||||||
cursor_mode = 2u32 & available_cursor_modes;
|
// cursor_mode = PORTAL_CURSOR_MODE_METADATA & available_cursor_modes;
|
||||||
}
|
// }
|
||||||
if cursor_mode == 0 {
|
if cursor_mode == 0 {
|
||||||
cursor_mode = 1u32 & available_cursor_modes;
|
cursor_mode = PORTAL_CURSOR_MODE_HIDDEN & available_cursor_modes;
|
||||||
}
|
}
|
||||||
let plasma = std::env::var("DESKTOP_SESSION").map_or(false, |s| s.contains("plasma"));
|
let plasma = std::env::var("DESKTOP_SESSION").map_or(false, |s| s.contains("plasma"));
|
||||||
if plasma && capture_cursor {
|
if plasma && capture_cursor {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user