mirror of
https://github.com/weyne85/rustdesk.git
synced 2025-10-29 17:00:05 +00:00
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:
@@ -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,
|
||||
|
||||
@@ -1173,6 +1173,8 @@ class ImageModel with ChangeNotifier {
|
||||
|
||||
addCallbackOnFirstImage(Function(String) cb) => callbacksOnFirstImage.add(cb);
|
||||
|
||||
clearImage() => _image = null;
|
||||
|
||||
onRgba(int display, Uint8List rgba) {
|
||||
final pid = parent.target?.id;
|
||||
final rect = parent.target?.ffiModel.pi.getDisplayRect(display);
|
||||
|
||||
Reference in New Issue
Block a user