feat, input source, win->win

Signed-off-by: fufesou <shuanglongchen@yeah.net>
This commit is contained in:
fufesou
2023-11-29 11:24:03 +08:00
parent f11104fcb5
commit 4cbbb5b64f
8 changed files with 89 additions and 99 deletions

View File

@@ -5,8 +5,6 @@ use crate::{
use async_trait::async_trait;
use bytes::Bytes;
use rdev::{Event, EventType::*, KeyCode};
#[cfg(not(any(target_os = "android", target_os = "ios")))]
use std::sync::atomic::{AtomicBool, Ordering};
use std::{
collections::HashMap,
ops::{Deref, DerefMut},
@@ -43,9 +41,6 @@ use crate::common::GrabState;
use crate::keyboard;
use crate::{client::Data, client::Interface};
#[cfg(not(any(target_os = "android", target_os = "ios")))]
pub static IS_IN: AtomicBool = AtomicBool::new(false);
const CHANGE_RESOLUTION_VALID_TIMEOUT_SECS: u64 = 15;
#[derive(Clone, Default)]
@@ -725,13 +720,11 @@ impl<T: InvokeUiSession> Session<T> {
#[cfg(not(any(target_os = "android", target_os = "ios")))]
pub fn enter(&self, keyboard_mode: String) {
IS_IN.store(true, Ordering::SeqCst);
keyboard::client::change_grab_status(GrabState::Run, &keyboard_mode);
}
#[cfg(not(any(target_os = "android", target_os = "ios")))]
pub fn leave(&self, keyboard_mode: String) {
IS_IN.store(false, Ordering::SeqCst);
keyboard::client::change_grab_status(GrabState::Wait, &keyboard_mode);
}