temp commit

Signed-off-by: fufesou <shuanglongchen@yeah.net>
This commit is contained in:
fufesou
2023-03-30 18:16:48 +08:00
parent 34c3615320
commit d82d2471d7
7 changed files with 71 additions and 26 deletions

View File

@@ -21,9 +21,6 @@ use std::{
type Xdo = *const c_void;
pub const ENV_DESKTOP_PROTOCAL_WAYLAND: &str = "wayland";
pub const ENV_DESKTOP_PROTOCAL_X11: &str = "x11";
pub const PA_SAMPLE_RATE: u32 = 48000;
static mut UNMODIFIED: bool = true;
@@ -403,12 +400,6 @@ pub fn get_active_userid() -> String {
get_values_of_seat0(&[1])[0].clone()
}
#[inline]
pub fn is_gdm_user(username: &str) -> bool {
username == "gdm"
// || username == "lightgdm"
}
fn get_cm() -> bool {
if let Ok(output) = Command::new("ps").args(vec!["aux"]).output() {
for line in String::from_utf8_lossy(&output.stdout).lines() {
@@ -809,7 +800,7 @@ mod desktop {
#[inline]
pub fn is_login_wayland(&self) -> bool {
super::is_gdm_user(&self.username) && self.protocal == ENV_DESKTOP_PROTOCAL_WAYLAND
super::is_gdm_user(&self.username) && self.protocal == DISPLAY_SERVER_WAYLAND
}
#[inline]
@@ -961,6 +952,7 @@ mod desktop {
if self.is_login_wayland() {
self.display = "".to_owned();
self.xauth = "".to_owned();
self.is_rustdesk_subprocess = false;
return;
}

View File

@@ -123,15 +123,15 @@ impl DesktopManager {
pub fn new() -> Self {
let mut seat0_username = "".to_owned();
let mut seat0_display_server = "".to_owned();
let seat0_values = get_values_of_seat0(&[0, 1, 2]);
println!(
"REMOVE ME ================================== DesktopManager: {:?}",
&seat0_values
);
let seat0_values = get_values_of_seat0(&[0, 2]);
if !seat0_values[0].is_empty() {
seat0_username = seat0_values[2].clone();
seat0_display_server = get_display_server_of_session(&seat0_values[1]);
seat0_username = seat0_values[1].clone();
seat0_display_server = get_display_server_of_session(&seat0_values[0]);
}
println!(
"REMOVE ME ================================== DesktopManager: {:?}, display server: {}",
&seat0_values, &seat0_display_server
);
Self {
seat0_username,
@@ -144,7 +144,7 @@ impl DesktopManager {
fn get_supported_display_seat0_username(&self) -> Option<String> {
if is_gdm_user(&self.seat0_username)
&& self.seat0_display_server == ENV_DESKTOP_PROTOCAL_WAYLAND
&& self.seat0_display_server == DISPLAY_SERVER_WAYLAND
{
None
} else {