mirror of
https://github.com/rustdesk/rustdesk.git
synced 2024-12-11 09:49:11 +08:00
Merge pull request #6575 from fufesou/fix/android_switch_display
fix, android switch display. Remove old display video subscription.
This commit is contained in:
commit
83b74c0930
@ -2703,7 +2703,10 @@ openMonitorInTheSameTab(int i, FFI ffi, PeerInfo pi) {
|
||||
? List.generate(pi.displays.length, (index) => index)
|
||||
: [i];
|
||||
bind.sessionSwitchDisplay(
|
||||
sessionId: ffi.sessionId, value: Int32List.fromList(displays));
|
||||
isDesktop: isDesktop,
|
||||
sessionId: ffi.sessionId,
|
||||
value: Int32List.fromList(displays),
|
||||
);
|
||||
ffi.ffiModel.switchToNewDisplay(i, ffi.sessionId, ffi.id);
|
||||
}
|
||||
|
||||
|
@ -395,8 +395,10 @@ class FfiModel with ChangeNotifier {
|
||||
msgBox(sessionId, 'custom-nook-nocancel-hasclose-info', 'Prompt',
|
||||
'elevated_switch_display_msg', '', parent.target!.dialogManager);
|
||||
bind.sessionSwitchDisplay(
|
||||
sessionId: sessionId,
|
||||
value: Int32List.fromList([pi.primaryDisplay]));
|
||||
isDesktop: isDesktop,
|
||||
sessionId: sessionId,
|
||||
value: Int32List.fromList([pi.primaryDisplay]),
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -788,7 +790,10 @@ class FfiModel with ChangeNotifier {
|
||||
|
||||
// move to the first display and set fullscreen
|
||||
bind.sessionSwitchDisplay(
|
||||
sessionId: sessionId, value: Int32List.fromList([0]));
|
||||
isDesktop: isDesktop,
|
||||
sessionId: sessionId,
|
||||
value: Int32List.fromList([0]),
|
||||
);
|
||||
_pi.currentDisplay = 0;
|
||||
try {
|
||||
CurrentDisplayState.find(peerId).value = _pi.currentDisplay;
|
||||
@ -899,7 +904,10 @@ class FfiModel with ChangeNotifier {
|
||||
: pi.primaryDisplay;
|
||||
final displays = newDisplay;
|
||||
bind.sessionSwitchDisplay(
|
||||
sessionId: sessionId, value: Int32List.fromList([displays]));
|
||||
isDesktop: isDesktop,
|
||||
sessionId: sessionId,
|
||||
value: Int32List.fromList([displays]),
|
||||
);
|
||||
|
||||
if (_pi.isSupportMultiUiSession) {
|
||||
// If the peer supports multi-ui-session, no switch display message will be send back.
|
||||
|
@ -1509,7 +1509,7 @@ pub mod sessions {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn session_switch_display(session_id: SessionID, value: Vec<i32>) {
|
||||
pub fn session_switch_display(is_desktop: bool, session_id: SessionID, value: Vec<i32>) {
|
||||
for s in SESSIONS.read().unwrap().values() {
|
||||
let read_lock = s.ui_handler.session_handlers.read().unwrap();
|
||||
if read_lock.contains_key(&session_id) {
|
||||
@ -1519,15 +1519,19 @@ pub mod sessions {
|
||||
// The switch display message will contain `SupportedResolutions`, which is useful when changing resolutions.
|
||||
s.switch_display(value[0]);
|
||||
|
||||
// Check if other displays are needed.
|
||||
#[cfg(feature = "flutter_texture_render")]
|
||||
if value.len() == 1 {
|
||||
check_remove_unused_displays(
|
||||
Some(value[0] as _),
|
||||
&session_id,
|
||||
&s,
|
||||
&read_lock,
|
||||
);
|
||||
if !is_desktop {
|
||||
s.capture_displays(vec![], vec![], value);
|
||||
} else {
|
||||
// Check if other displays are needed.
|
||||
#[cfg(feature = "flutter_texture_render")]
|
||||
if value.len() == 1 {
|
||||
check_remove_unused_displays(
|
||||
Some(value[0] as _),
|
||||
&session_id,
|
||||
&s,
|
||||
&read_lock,
|
||||
);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// Try capture all displays.
|
||||
|
@ -439,8 +439,8 @@ pub fn session_ctrl_alt_del(session_id: SessionID) {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn session_switch_display(session_id: SessionID, value: Vec<i32>) {
|
||||
sessions::session_switch_display(session_id, value);
|
||||
pub fn session_switch_display(is_desktop: bool, session_id: SessionID, value: Vec<i32>) {
|
||||
sessions::session_switch_display(is_desktop, session_id, value);
|
||||
}
|
||||
|
||||
pub fn session_handle_flutter_key_event(
|
||||
|
Loading…
Reference in New Issue
Block a user