mirror of
https://github.com/rustdesk/rustdesk.git
synced 2026-04-15 12:51:28 +03: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
|
// Notify to switch display
|
||||||
msgBox(sessionId, 'custom-nook-nocancel-hasclose-info', 'Prompt',
|
msgBox(sessionId, 'custom-nook-nocancel-hasclose-info', 'Prompt',
|
||||||
'display_is_plugged_out_msg', '', parent.target!.dialogManager);
|
'display_is_plugged_out_msg', '', parent.target!.dialogManager);
|
||||||
final newDisplay = pi.primaryDisplay == kInvalidDisplayIndex
|
final isPeerPrimaryDisplayValid =
|
||||||
? 0
|
pi.primaryDisplay == kInvalidDisplayIndex ||
|
||||||
: pi.primaryDisplay;
|
pi.primaryDisplay >= pi.displays.length;
|
||||||
final displays = newDisplay;
|
final newDisplay =
|
||||||
|
isPeerPrimaryDisplayValid ? 0 : pi.primaryDisplay;
|
||||||
bind.sessionSwitchDisplay(
|
bind.sessionSwitchDisplay(
|
||||||
isDesktop: isDesktop,
|
isDesktop: isDesktop,
|
||||||
sessionId: sessionId,
|
sessionId: sessionId,
|
||||||
value: Int32List.fromList([displays]),
|
value: Int32List.fromList([newDisplay]),
|
||||||
);
|
);
|
||||||
|
|
||||||
if (_pi.isSupportMultiUiSession) {
|
if (_pi.isSupportMultiUiSession) {
|
||||||
|
|||||||
Reference in New Issue
Block a user