refact, separate remote window

Signed-off-by: dignow <linlong1265@gmail.com>
This commit is contained in:
dignow 2023-08-05 19:48:32 +08:00
parent 5817e48e17
commit 2db8f1f9d1
2 changed files with 6 additions and 5 deletions

View File

@ -1656,13 +1656,13 @@ class FFI {
final cb = ffiModel.startEventListener(sessionId, id);
final useTextureRender = bind.mainUseTextureRender();
final SimpleWrapper<bool> isCacheRestored = SimpleWrapper(false);
final SimpleWrapper<bool> isToNewWindowNotified = SimpleWrapper(false);
// Preserved for the rgba data.
stream.listen((message) {
if (closed) return;
if (isSessionAdded && !isCacheRestored.value) {
bind.sessionRestoreCache(sessionId: sessionId);
isCacheRestored.value = true;
if (isSessionAdded && !isToNewWindowNotified.value) {
bind.sessionReadyToNewWindow(sessionId: sessionId);
isToNewWindowNotified.value = true;
}
() async {
if (message is EventToUI_Event) {

View File

@ -601,10 +601,11 @@ pub fn session_change_resolution(session_id: SessionID, display: i32, width: i32
}
}
pub fn session_restore_cache(session_id: SessionID) {
pub fn session_ready_to_new_window(session_id: SessionID) {
#[cfg(not(any(target_os = "android", target_os = "ios")))]
if let Some(session) = SESSIONS.write().unwrap().get_mut(&session_id) {
session.restore_flutter_cache();
session.refresh_video();
}
}