fix build, sciter

Signed-off-by: dignow <linlong1265@gmail.com>
This commit is contained in:
dignow 2023-10-08 23:32:11 +08:00
parent 2f2a7d1f89
commit 3bb7123dd5
7 changed files with 18 additions and 8 deletions

View File

@ -1926,7 +1926,7 @@ where
//
// to-do: fix the error
log::error!("handle video frame error, {}", e);
session.refresh_video(display);
session.refresh_video(display as _);
}
_ => {}
}

View File

@ -1008,7 +1008,7 @@ impl<T: InvokeUiSession> Remote<T> {
{
// Refresh causes client set_display, left frames cause flickering.
while let Some(_) = video_queue.pop() {}
self.handler.refresh_video(*display);
self.handler.refresh_video(*display as _);
ctl.refresh_times += 1;
ctl.last_refresh_instant = Instant::now();
}

View File

@ -180,7 +180,7 @@ pub fn session_close(session_id: SessionID) {
pub fn session_refresh(session_id: SessionID, display: usize) {
if let Some(session) = sessions::get_session_by_session_id(&session_id) {
session.refresh_video(display);
session.refresh_video(display as _);
}
}

View File

@ -1970,6 +1970,8 @@ impl Connection {
}
Some(misc::Union::RefreshVideo(r)) => {
if r {
// Refresh all videos.
// Compatibility with old versions and sciter(remote).
self.refresh_video_display(None);
}
self.update_auto_disconnect_timer();

View File

@ -298,8 +298,9 @@ class Header: Reactor.Component {
recording = !recording;
header.update();
handler.record_status(recording);
// 0 is just a dummy value. It will be ignored by the handler.
if (recording)
handler.refresh_video();
handler.refresh_video(0);
else
handler.record_screen(false, 0, display_width, display_height);
}
@ -370,7 +371,8 @@ class Header: Reactor.Component {
}
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) {

View File

@ -453,7 +453,7 @@ impl sciter::EventHandler for SciterSession {
fn save_view_style(String);
fn save_image_quality(String);
fn save_custom_image_quality(i32);
fn refresh_video();
fn refresh_video(i32);
fn record_screen(bool, i32, i32, i32);
fn record_status(bool);
fn get_toggle_option(String);

View File

@ -282,14 +282,20 @@ impl<T: InvokeUiSession> Session<T> {
&& !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) {
self.send(Data::Message(LoginConfigHandler::refresh_display(display)));
self.send(Data::Message(LoginConfigHandler::refresh_display(display as _)));
} else {
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) {
self.send(Data::RecordScreen(
start,