Merge pull request #5222 from dignow/refact/win_file_clipboard_on_control_side
refact, win file clipboard enable
This commit is contained in:
		
						commit
						c33dd8e2ef
					
				| @ -149,7 +149,6 @@ pub fn core_main() -> Option<Vec<String>> { | |||||||
|     } |     } | ||||||
|     #[cfg(windows)] |     #[cfg(windows)] | ||||||
|     if !crate::platform::is_installed() && (_is_elevate || _is_run_as_system) { |     if !crate::platform::is_installed() && (_is_elevate || _is_run_as_system) { | ||||||
|         clipboard::ContextSend::enable(true); |  | ||||||
|         crate::platform::elevate_or_run_as_system(click_setup, _is_elevate, _is_run_as_system); |         crate::platform::elevate_or_run_as_system(click_setup, _is_elevate, _is_run_as_system); | ||||||
|         return None; |         return None; | ||||||
|     } |     } | ||||||
| @ -158,8 +157,6 @@ pub fn core_main() -> Option<Vec<String>> { | |||||||
|     init_plugins(&args); |     init_plugins(&args); | ||||||
|     log::info!("main start args:{:?}", args); |     log::info!("main start args:{:?}", args); | ||||||
|     if args.is_empty() || is_empty_uni_link(&args[0]) { |     if args.is_empty() || is_empty_uni_link(&args[0]) { | ||||||
|         #[cfg(windows)] |  | ||||||
|         clipboard::ContextSend::enable(true); |  | ||||||
|         std::thread::spawn(move || crate::start_server(false)); |         std::thread::spawn(move || crate::start_server(false)); | ||||||
|     } else { |     } else { | ||||||
|         #[cfg(windows)] |         #[cfg(windows)] | ||||||
|  | |||||||
| @ -1185,6 +1185,12 @@ impl<T: InvokeUiSession> Session<T> { | |||||||
| 
 | 
 | ||||||
| #[tokio::main(flavor = "current_thread")] | #[tokio::main(flavor = "current_thread")] | ||||||
| pub async fn io_loop<T: InvokeUiSession>(handler: Session<T>) { | pub async fn io_loop<T: InvokeUiSession>(handler: Session<T>) { | ||||||
|  |     // It is ok to call this function multiple times.
 | ||||||
|  |     #[cfg(target_os ="windows")] | ||||||
|  |     if !handler.is_file_transfer() && !handler.is_port_forward() { | ||||||
|  |         clipboard::ContextSend::enable(true); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|     #[cfg(any(target_os = "android", target_os = "ios"))] |     #[cfg(any(target_os = "android", target_os = "ios"))] | ||||||
|     let (sender, receiver) = mpsc::unbounded_channel::<Data>(); |     let (sender, receiver) = mpsc::unbounded_channel::<Data>(); | ||||||
|     #[cfg(not(any(target_os = "android", target_os = "ios")))] |     #[cfg(not(any(target_os = "android", target_os = "ios")))] | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user