fix: siwtching display, clear last old image (#8810)

* fix: siwtching display, clear last old image

1. Clear last old image.
2. Try refresh after switching display.
3. Add an interval check before refresh video service.

Signed-off-by: dignow <linlong1265@gmail.com>

* simple changes

Signed-off-by: dignow <linlong1265@gmail.com>

---------

Signed-off-by: dignow <linlong1265@gmail.com>
This commit is contained in:
dignow 2024-07-24 17:35:06 +08:00 committed by GitHub
parent c04f460bbd
commit 39dbd89287
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 40 additions and 3 deletions

View file

@ -2935,6 +2935,16 @@ openMonitorInTheSameTab(int i, FFI ffi, PeerInfo pi,
final displays = i == kAllDisplayValue
? List.generate(pi.displays.length, (index) => index)
: [i];
// Try clear image model before switching from all displays
// 1. The remote side has multiple displays.
// 2. Do not use texture render.
// 3. Connect to Display 1.
// 4. Switch to multi-displays `kAllDisplayValue`
// 5. Switch to Display 2.
// Then the remote page will display last picture of Display 1 at the beginning.
if (pi.forceTextureRender && i != kAllDisplayValue) {
ffi.imageModel.clearImage();
}
bind.sessionSwitchDisplay(
isDesktop: isDesktop,
sessionId: ffi.sessionId,