mirror of
https://github.com/rustdesk/rustdesk.git
synced 2024-11-24 12:29:04 +08:00
fix: hook for pc only
This commit is contained in:
parent
05ac93ec40
commit
f56fc6fdb0
5
.github/workflows/flutter-build.yml
vendored
5
.github/workflows/flutter-build.yml
vendored
@ -400,7 +400,7 @@ jobs:
|
||||
shell: bash
|
||||
run: |
|
||||
pushd /opt
|
||||
git clone https://github.com/Kingtous/rustdesk_thirdparty_lib.git --depth=1
|
||||
sudo git clone https://github.com/Kingtous/rustdesk_thirdparty_lib.git --depth=1
|
||||
|
||||
- name: Restore bridge files
|
||||
uses: actions/download-artifact@master
|
||||
@ -422,8 +422,9 @@ jobs:
|
||||
key: ${{ matrix.job.target }}-${{ matrix.job.extra-build-features }}
|
||||
|
||||
- name: Disable rust bridge build
|
||||
shell: bash
|
||||
run: |
|
||||
sed -i "s/gen_flutter_rust_bridge();/\/\//g" build.rs
|
||||
sed -i build.rs.bak "s/gen_flutter_rust_bridge();/\/\//g" build.rs
|
||||
|
||||
- name: Build rustdesk lib
|
||||
env:
|
||||
|
@ -1,5 +1,4 @@
|
||||
use crate::{
|
||||
api::SessionHook,
|
||||
client::*,
|
||||
flutter_ffi::EventToUI,
|
||||
ui_session_interface::{io_loop, InvokeUiSession, Session},
|
||||
@ -147,7 +146,8 @@ pub struct FlutterHandler {
|
||||
notify_rendered: Arc<RwLock<bool>>,
|
||||
renderer: Arc<RwLock<VideoRenderer>>,
|
||||
peer_info: Arc<RwLock<PeerInfo>>,
|
||||
hooks: Arc<RwLock<HashMap<String, SessionHook>>>,
|
||||
#[cfg(not(any(target_os = "android", target_os = "ios")))]
|
||||
hooks: Arc<RwLock<HashMap<String, crate::api::SessionHook>>>,
|
||||
}
|
||||
|
||||
#[cfg(not(feature = "flutter_texture_render"))]
|
||||
@ -159,7 +159,8 @@ pub struct FlutterHandler {
|
||||
pub rgba: Arc<RwLock<Vec<u8>>>,
|
||||
pub rgba_valid: Arc<AtomicBool>,
|
||||
peer_info: Arc<RwLock<PeerInfo>>,
|
||||
hooks: Arc<RwLock<HashMap<String, SessionHook>>>,
|
||||
#[cfg(not(any(target_os = "android", target_os = "ios")))]
|
||||
hooks: Arc<RwLock<HashMap<String, crate::api::SessionHook>>>,
|
||||
}
|
||||
|
||||
#[cfg(feature = "flutter_texture_render")]
|
||||
@ -280,6 +281,7 @@ impl FlutterHandler {
|
||||
serde_json::ser::to_string(&msg_vec).unwrap_or("".to_owned())
|
||||
}
|
||||
|
||||
#[cfg(not(any(target_os = "android", target_os = "ios")))]
|
||||
pub(crate) fn add_session_hook(&self, key: String, hook: crate::api::SessionHook) -> bool {
|
||||
let mut hooks = self.hooks.write().unwrap();
|
||||
if hooks.contains_key(&key) {
|
||||
@ -290,6 +292,7 @@ impl FlutterHandler {
|
||||
true
|
||||
}
|
||||
|
||||
#[cfg(not(any(target_os = "android", target_os = "ios")))]
|
||||
pub(crate) fn remove_session_hook(&self, key: &String) -> bool {
|
||||
let mut hooks = self.hooks.write().unwrap();
|
||||
if !hooks.contains_key(key) {
|
||||
|
@ -49,8 +49,10 @@ mod license;
|
||||
mod port_forward;
|
||||
|
||||
#[cfg(not(any(target_os = "android", target_os = "ios")))]
|
||||
#[cfg(any(feature = "flutter"))]
|
||||
pub mod api;
|
||||
#[cfg(not(any(target_os = "android", target_os = "ios")))]
|
||||
#[cfg(any(feature = "flutter"))]
|
||||
pub mod plugins;
|
||||
|
||||
mod tray;
|
||||
|
Loading…
Reference in New Issue
Block a user