File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -16,6 +16,12 @@ import 'package:get/get.dart';
1616
1717bool isEditOsPassword = false ;
1818
19+ // macOS privacy mode blacks out all online displays, so switching the remote
20+ // display does not weaken the local privacy protection.
21+ bool allowDisplaySwitchInPrivacyMode (PeerInfo pi) {
22+ return pi.platform == kPeerPlatformMacOS;
23+ }
24+
1925class TTextMenu {
2026 final Widget child;
2127 final VoidCallback ? onPressed;
@@ -684,8 +690,9 @@ Future<List<TToggleMenu>> toolbarDisplayToggle(
684690 child: Text (translate ('Lock after session end' ))));
685691 }
686692
693+ final privacyModeState = PrivacyModeState .find (id);
687694 if (pi.isSupportMultiDisplay &&
688- PrivacyModeState . find (id) .isEmpty &&
695+ (privacyModeState .isEmpty || allowDisplaySwitchInPrivacyMode (pi)) &&
689696 pi.displaysCount.value > 1 &&
690697 bind.mainGetUserDefaultOption (key: kKeyShowMonitorsToolbar) == 'Y' ) {
691698 final value =
@@ -776,7 +783,8 @@ List<TToggleMenu> toolbarPrivacyMode(
776783 onChanged: enabled
777784 ? (value) {
778785 if (value == null ) return ;
779- if (ffiModel.pi.currentDisplay != 0 &&
786+ if (! allowDisplaySwitchInPrivacyMode (pi) &&
787+ ffiModel.pi.currentDisplay != 0 &&
780788 ffiModel.pi.currentDisplay != kAllDisplayValue) {
781789 msgBox (
782790 sessionId,
Original file line number Diff line number Diff line change @@ -376,7 +376,8 @@ class _RemoteToolbarState extends State<RemoteToolbar> {
376376 }
377377
378378 toolbarItems.add (Obx (() {
379- if (PrivacyModeState .find (widget.id).isEmpty &&
379+ if ((PrivacyModeState .find (widget.id).isEmpty ||
380+ allowDisplaySwitchInPrivacyMode (pi)) &&
380381 pi.displaysCount.value > 1 ) {
381382 return _MonitorMenu (
382383 id: widget.id,
You can’t perform that action at this time.
0 commit comments