elevation: keyboard permission required and remove foreground filter

Signed-off-by: 21pages <pages21@163.com>
This commit is contained in:
21pages
2023-09-30 19:47:59 +08:00
parent d8e51c6b14
commit 17a56bbf48
41 changed files with 69 additions and 45 deletions

View File

@@ -2047,12 +2047,18 @@ impl Connection {
#[cfg(windows)]
async fn handle_elevation_request(&mut self, para: portable_client::StartPara) {
let mut err = "No need to elevate".to_string();
if !crate::platform::is_installed() && !portable_client::running() {
err = portable_client::start_portable_service(para)
.err()
.map_or("".to_string(), |e| e.to_string());
let mut err;
if !self.keyboard {
err = "No permission".to_string();
} else {
err = "No need to elevate".to_string();
if !crate::platform::is_installed() && !portable_client::running() {
err = portable_client::start_portable_service(para)
.err()
.map_or("".to_string(), |e| e.to_string());
}
}
let mut misc = Misc::new();
misc.set_elevation_response(err);
let mut msg = Message::new();
@@ -2369,6 +2375,7 @@ impl Connection {
if self.portable.is_installed
|| self.file_transfer.is_some()
|| self.port_forward_socket.is_some()
|| !self.keyboard
{
return;
}