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:
parent
6820e2f4c7
commit
3c6ddd7403
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user