mirror of
https://github.com/rustdesk/rustdesk.git
synced 2025-12-12 11:06:57 +00:00
fix: multi-displays, displays changed, switch idx (#9006)
Use init display index as the primary index. But when displays changed, the primary display may also changes. No need to change the old primary index. But we need to make sure that the old primary index does not exceed the display number. Signed-off-by: fufesou <linlong1266@gmail.com>
This commit is contained in:
@@ -1003,14 +1003,15 @@ class FfiModel with ChangeNotifier {
|
||||
// Notify to switch display
|
||||
msgBox(sessionId, 'custom-nook-nocancel-hasclose-info', 'Prompt',
|
||||
'display_is_plugged_out_msg', '', parent.target!.dialogManager);
|
||||
final newDisplay = pi.primaryDisplay == kInvalidDisplayIndex
|
||||
? 0
|
||||
: pi.primaryDisplay;
|
||||
final displays = newDisplay;
|
||||
final isPeerPrimaryDisplayValid =
|
||||
pi.primaryDisplay == kInvalidDisplayIndex ||
|
||||
pi.primaryDisplay >= pi.displays.length;
|
||||
final newDisplay =
|
||||
isPeerPrimaryDisplayValid ? 0 : pi.primaryDisplay;
|
||||
bind.sessionSwitchDisplay(
|
||||
isDesktop: isDesktop,
|
||||
sessionId: sessionId,
|
||||
value: Int32List.fromList([displays]),
|
||||
value: Int32List.fromList([newDisplay]),
|
||||
);
|
||||
|
||||
if (_pi.isSupportMultiUiSession) {
|
||||
|
||||
Reference in New Issue
Block a user