mirror of
https://github.com/rustdesk/rustdesk.git
synced 2025-01-19 16:33:01 +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)
|
? List.generate(pi.displays.length, (index) => index)
|
||||||
: [i];
|
: [i];
|
||||||
bind.sessionSwitchDisplay(
|
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);
|
ffi.ffiModel.switchToNewDisplay(i, ffi.sessionId, ffi.id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -395,8 +395,10 @@ class FfiModel with ChangeNotifier {
|
|||||||
msgBox(sessionId, 'custom-nook-nocancel-hasclose-info', 'Prompt',
|
msgBox(sessionId, 'custom-nook-nocancel-hasclose-info', 'Prompt',
|
||||||
'elevated_switch_display_msg', '', parent.target!.dialogManager);
|
'elevated_switch_display_msg', '', parent.target!.dialogManager);
|
||||||
bind.sessionSwitchDisplay(
|
bind.sessionSwitchDisplay(
|
||||||
|
isDesktop: isDesktop,
|
||||||
sessionId: sessionId,
|
sessionId: sessionId,
|
||||||
value: Int32List.fromList([pi.primaryDisplay]));
|
value: Int32List.fromList([pi.primaryDisplay]),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -788,7 +790,10 @@ class FfiModel with ChangeNotifier {
|
|||||||
|
|
||||||
// move to the first display and set fullscreen
|
// move to the first display and set fullscreen
|
||||||
bind.sessionSwitchDisplay(
|
bind.sessionSwitchDisplay(
|
||||||
sessionId: sessionId, value: Int32List.fromList([0]));
|
isDesktop: isDesktop,
|
||||||
|
sessionId: sessionId,
|
||||||
|
value: Int32List.fromList([0]),
|
||||||
|
);
|
||||||
_pi.currentDisplay = 0;
|
_pi.currentDisplay = 0;
|
||||||
try {
|
try {
|
||||||
CurrentDisplayState.find(peerId).value = _pi.currentDisplay;
|
CurrentDisplayState.find(peerId).value = _pi.currentDisplay;
|
||||||
@ -899,7 +904,10 @@ class FfiModel with ChangeNotifier {
|
|||||||
: pi.primaryDisplay;
|
: pi.primaryDisplay;
|
||||||
final displays = newDisplay;
|
final displays = newDisplay;
|
||||||
bind.sessionSwitchDisplay(
|
bind.sessionSwitchDisplay(
|
||||||
sessionId: sessionId, value: Int32List.fromList([displays]));
|
isDesktop: isDesktop,
|
||||||
|
sessionId: sessionId,
|
||||||
|
value: Int32List.fromList([displays]),
|
||||||
|
);
|
||||||
|
|
||||||
if (_pi.isSupportMultiUiSession) {
|
if (_pi.isSupportMultiUiSession) {
|
||||||
// If the peer supports multi-ui-session, no switch display message will be send back.
|
// 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() {
|
for s in SESSIONS.read().unwrap().values() {
|
||||||
let read_lock = s.ui_handler.session_handlers.read().unwrap();
|
let read_lock = s.ui_handler.session_handlers.read().unwrap();
|
||||||
if read_lock.contains_key(&session_id) {
|
if read_lock.contains_key(&session_id) {
|
||||||
@ -1519,6 +1519,9 @@ pub mod sessions {
|
|||||||
// The switch display message will contain `SupportedResolutions`, which is useful when changing resolutions.
|
// The switch display message will contain `SupportedResolutions`, which is useful when changing resolutions.
|
||||||
s.switch_display(value[0]);
|
s.switch_display(value[0]);
|
||||||
|
|
||||||
|
if !is_desktop {
|
||||||
|
s.capture_displays(vec![], vec![], value);
|
||||||
|
} else {
|
||||||
// Check if other displays are needed.
|
// Check if other displays are needed.
|
||||||
#[cfg(feature = "flutter_texture_render")]
|
#[cfg(feature = "flutter_texture_render")]
|
||||||
if value.len() == 1 {
|
if value.len() == 1 {
|
||||||
@ -1529,6 +1532,7 @@ pub mod sessions {
|
|||||||
&read_lock,
|
&read_lock,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
// Try capture all displays.
|
// Try capture all displays.
|
||||||
s.capture_displays(vec![], vec![], value);
|
s.capture_displays(vec![], vec![], value);
|
||||||
|
@ -439,8 +439,8 @@ pub fn session_ctrl_alt_del(session_id: SessionID) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
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>) {
|
||||||
sessions::session_switch_display(session_id, value);
|
sessions::session_switch_display(is_desktop, session_id, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn session_handle_flutter_key_event(
|
pub fn session_handle_flutter_key_event(
|
||||||
|
Loading…
Reference in New Issue
Block a user