fix build, sciter
Signed-off-by: dignow <linlong1265@gmail.com>
This commit is contained in:
		
							parent
							
								
									2f2a7d1f89
								
							
						
					
					
						commit
						3bb7123dd5
					
				| @ -1926,7 +1926,7 @@ where | |||||||
|                                     //
 |                                     //
 | ||||||
|                                     // to-do: fix the error
 |                                     // to-do: fix the error
 | ||||||
|                                     log::error!("handle video frame error, {}", e); |                                     log::error!("handle video frame error, {}", e); | ||||||
|                                     session.refresh_video(display); |                                     session.refresh_video(display as _); | ||||||
|                                 } |                                 } | ||||||
|                                 _ => {} |                                 _ => {} | ||||||
|                             } |                             } | ||||||
|  | |||||||
| @ -1008,7 +1008,7 @@ impl<T: InvokeUiSession> Remote<T> { | |||||||
|             { |             { | ||||||
|                 // Refresh causes client set_display, left frames cause flickering.
 |                 // Refresh causes client set_display, left frames cause flickering.
 | ||||||
|                 while let Some(_) = video_queue.pop() {} |                 while let Some(_) = video_queue.pop() {} | ||||||
|                 self.handler.refresh_video(*display); |                 self.handler.refresh_video(*display as _); | ||||||
|                 ctl.refresh_times += 1; |                 ctl.refresh_times += 1; | ||||||
|                 ctl.last_refresh_instant = Instant::now(); |                 ctl.last_refresh_instant = Instant::now(); | ||||||
|             } |             } | ||||||
|  | |||||||
| @ -180,7 +180,7 @@ pub fn session_close(session_id: SessionID) { | |||||||
| 
 | 
 | ||||||
| pub fn session_refresh(session_id: SessionID, display: usize) { | pub fn session_refresh(session_id: SessionID, display: usize) { | ||||||
|     if let Some(session) = sessions::get_session_by_session_id(&session_id) { |     if let Some(session) = sessions::get_session_by_session_id(&session_id) { | ||||||
|         session.refresh_video(display); |         session.refresh_video(display as _); | ||||||
|     } |     } | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -1970,6 +1970,8 @@ impl Connection { | |||||||
|                     } |                     } | ||||||
|                     Some(misc::Union::RefreshVideo(r)) => { |                     Some(misc::Union::RefreshVideo(r)) => { | ||||||
|                         if r { |                         if r { | ||||||
|  |                             // Refresh all videos.
 | ||||||
|  |                             // Compatibility with old versions and sciter(remote).
 | ||||||
|                             self.refresh_video_display(None); |                             self.refresh_video_display(None); | ||||||
|                         } |                         } | ||||||
|                         self.update_auto_disconnect_timer(); |                         self.update_auto_disconnect_timer(); | ||||||
|  | |||||||
| @ -298,8 +298,9 @@ class Header: Reactor.Component { | |||||||
|         recording = !recording; |         recording = !recording; | ||||||
|         header.update(); |         header.update(); | ||||||
|         handler.record_status(recording); |         handler.record_status(recording); | ||||||
|  |         // 0 is just a dummy value. It will be ignored by the handler. | ||||||
|         if (recording) |         if (recording) | ||||||
|             handler.refresh_video(); |             handler.refresh_video(0); | ||||||
|         else |         else | ||||||
|             handler.record_screen(false, 0, display_width, display_height); |             handler.record_screen(false, 0, display_width, display_height); | ||||||
|     } |     } | ||||||
| @ -370,7 +371,8 @@ class Header: Reactor.Component { | |||||||
|     } |     } | ||||||
|      |      | ||||||
|     event click $(#refresh) { |     event click $(#refresh) { | ||||||
|         handler.refresh_video(); |         // 0 is just a dummy value. It will be ignored by the handler. | ||||||
|  |         handler.refresh_video(0); | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     event click $(#block-input) { |     event click $(#block-input) { | ||||||
|  | |||||||
| @ -453,7 +453,7 @@ impl sciter::EventHandler for SciterSession { | |||||||
|         fn save_view_style(String); |         fn save_view_style(String); | ||||||
|         fn save_image_quality(String); |         fn save_image_quality(String); | ||||||
|         fn save_custom_image_quality(i32); |         fn save_custom_image_quality(i32); | ||||||
|         fn refresh_video(); |         fn refresh_video(i32); | ||||||
|         fn record_screen(bool, i32, i32, i32); |         fn record_screen(bool, i32, i32, i32); | ||||||
|         fn record_status(bool); |         fn record_status(bool); | ||||||
|         fn get_toggle_option(String); |         fn get_toggle_option(String); | ||||||
|  | |||||||
| @ -282,14 +282,20 @@ impl<T: InvokeUiSession> Session<T> { | |||||||
|             && !self.lc.read().unwrap().disable_clipboard.v |             && !self.lc.read().unwrap().disable_clipboard.v | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     pub fn refresh_video(&self, display: usize) { |     #[cfg(feature = "flutter")] | ||||||
|  |     pub fn refresh_video(&self, display: i32) { | ||||||
|         if crate::common::is_support_multi_ui_session_num(self.lc.read().unwrap().version) { |         if crate::common::is_support_multi_ui_session_num(self.lc.read().unwrap().version) { | ||||||
|             self.send(Data::Message(LoginConfigHandler::refresh_display(display))); |             self.send(Data::Message(LoginConfigHandler::refresh_display(display as _))); | ||||||
|         } else { |         } else { | ||||||
|             self.send(Data::Message(LoginConfigHandler::refresh())); |             self.send(Data::Message(LoginConfigHandler::refresh())); | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|  |     #[cfg(not(feature = "flutter"))] | ||||||
|  |     pub fn refresh_video(&self, _display: i32) { | ||||||
|  |         self.send(Data::Message(LoginConfigHandler::refresh())); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|     pub fn record_screen(&self, start: bool, display: i32, w: i32, h: i32) { |     pub fn record_screen(&self, start: bool, display: i32, w: i32, h: i32) { | ||||||
|         self.send(Data::RecordScreen( |         self.send(Data::RecordScreen( | ||||||
|             start, |             start, | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user