mirror of
https://github.com/rustdesk/rustdesk.git
synced 2026-05-12 17:18:11 +03:00
Allow macOS monitor switching in privacy mode (#15004)
Co-authored-by: Codex <codex@openai.local>
This commit is contained in:
@@ -16,6 +16,12 @@ import 'package:get/get.dart';
|
|||||||
|
|
||||||
bool isEditOsPassword = false;
|
bool isEditOsPassword = false;
|
||||||
|
|
||||||
|
// macOS privacy mode blacks out all online displays, so switching the remote
|
||||||
|
// display does not weaken the local privacy protection.
|
||||||
|
bool allowDisplaySwitchInPrivacyMode(PeerInfo pi) {
|
||||||
|
return pi.platform == kPeerPlatformMacOS;
|
||||||
|
}
|
||||||
|
|
||||||
class TTextMenu {
|
class TTextMenu {
|
||||||
final Widget child;
|
final Widget child;
|
||||||
final VoidCallback? onPressed;
|
final VoidCallback? onPressed;
|
||||||
@@ -684,8 +690,9 @@ Future<List<TToggleMenu>> toolbarDisplayToggle(
|
|||||||
child: Text(translate('Lock after session end'))));
|
child: Text(translate('Lock after session end'))));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
final privacyModeState = PrivacyModeState.find(id);
|
||||||
if (pi.isSupportMultiDisplay &&
|
if (pi.isSupportMultiDisplay &&
|
||||||
PrivacyModeState.find(id).isEmpty &&
|
(privacyModeState.isEmpty || allowDisplaySwitchInPrivacyMode(pi)) &&
|
||||||
pi.displaysCount.value > 1 &&
|
pi.displaysCount.value > 1 &&
|
||||||
bind.mainGetUserDefaultOption(key: kKeyShowMonitorsToolbar) == 'Y') {
|
bind.mainGetUserDefaultOption(key: kKeyShowMonitorsToolbar) == 'Y') {
|
||||||
final value =
|
final value =
|
||||||
@@ -776,7 +783,8 @@ List<TToggleMenu> toolbarPrivacyMode(
|
|||||||
onChanged: enabled
|
onChanged: enabled
|
||||||
? (value) {
|
? (value) {
|
||||||
if (value == null) return;
|
if (value == null) return;
|
||||||
if (ffiModel.pi.currentDisplay != 0 &&
|
if (!allowDisplaySwitchInPrivacyMode(pi) &&
|
||||||
|
ffiModel.pi.currentDisplay != 0 &&
|
||||||
ffiModel.pi.currentDisplay != kAllDisplayValue) {
|
ffiModel.pi.currentDisplay != kAllDisplayValue) {
|
||||||
msgBox(
|
msgBox(
|
||||||
sessionId,
|
sessionId,
|
||||||
|
|||||||
@@ -376,7 +376,8 @@ class _RemoteToolbarState extends State<RemoteToolbar> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
toolbarItems.add(Obx(() {
|
toolbarItems.add(Obx(() {
|
||||||
if (PrivacyModeState.find(widget.id).isEmpty &&
|
if ((PrivacyModeState.find(widget.id).isEmpty ||
|
||||||
|
allowDisplaySwitchInPrivacyMode(pi)) &&
|
||||||
pi.displaysCount.value > 1) {
|
pi.displaysCount.value > 1) {
|
||||||
return _MonitorMenu(
|
return _MonitorMenu(
|
||||||
id: widget.id,
|
id: widget.id,
|
||||||
|
|||||||
Reference in New Issue
Block a user