diff --git a/.github/patches/hidecm.diff b/.github/patches/hidecm.diff
new file mode 100644
index 0000000..29e16a8
--- /dev/null
+++ b/.github/patches/hidecm.diff
@@ -0,0 +1,129 @@
+diff --git a/flutter/lib/desktop/pages/desktop_setting_page.dart b/flutter/lib/desktop/pages/desktop_setting_page.dart
+index 56a99446c..5991aceed 100644
+--- a/flutter/lib/desktop/pages/desktop_setting_page.dart
++++ b/flutter/lib/desktop/pages/desktop_setting_page.dart
+@@ -1101,8 +1101,8 @@ class _SafetyState extends State<_Safety> with AutomaticKeepAliveClientMixin {
+ if (usePassword)
+ _SubButton('Set permanent password', setPasswordDialog,
+ permEnabled && !locked),
+- // if (usePassword)
+- // hide_cm(!locked).marginOnly(left: _kContentHSubMargin - 6),
++ if (usePassword)
++ hide_cm(!locked).marginOnly(left: _kContentHSubMargin - 6),
+ if (usePassword) radios[2],
+ ]);
+ })));
+diff --git a/flutter/lib/main.dart b/flutter/lib/main.dart
+index 3032a2321..66d0d8c26 100644
+--- a/flutter/lib/main.dart
++++ b/flutter/lib/main.dart
+@@ -245,7 +245,7 @@ void runConnectionManagerScreen() async {
+ MyTheme.currentThemeMode(),
+ );
+ final hide = await bind.cmGetConfig(name: "hide_cm") == 'true';
+- gFFI.serverModel.hideCm = hide;
++ // gFFI.serverModel.hideCm = hide;
+ if (hide) {
+ await hideCmWindow(isStartup: true);
+ } else {
+diff --git a/flutter/lib/models/server_model.dart b/flutter/lib/models/server_model.dart
+index 877576461..4efd6c8b0 100644
+--- a/flutter/lib/models/server_model.dart
++++ b/flutter/lib/models/server_model.dart
+@@ -32,7 +32,7 @@ class ServerModel with ChangeNotifier {
+ bool _fileOk = false;
+ bool _clipboardOk = false;
+ bool _showElevation = false;
+- bool hideCm = false;
++ bool _hideCm = false;
+ int _connectStatus = 0; // Rendezvous Server status
+ String _verificationMethod = "";
+ String _temporaryPasswordLength = "";
+@@ -62,6 +62,8 @@ class ServerModel with ChangeNotifier {
+
+ bool get clipboardOk => _clipboardOk;
+
++ bool get hideCm => _hideCm;
++
+ bool get showElevation => _showElevation;
+
+ int get connectStatus => _connectStatus;
+@@ -82,12 +84,11 @@ class ServerModel with ChangeNotifier {
+
+ setVerificationMethod(String method) async {
+ await bind.mainSetOption(key: kOptionVerificationMethod, value: method);
+- /*
++
+ if (method != kUsePermanentPassword) {
+ await bind.mainSetOption(
+ key: 'allow-hide-cm', value: bool2option('allow-hide-cm', false));
+ }
+- */
+ }
+
+ String get temporaryPasswordLength {
+@@ -104,12 +105,11 @@ class ServerModel with ChangeNotifier {
+
+ setApproveMode(String mode) async {
+ await bind.mainSetOption(key: kOptionApproveMode, value: mode);
+- /*
++
+ if (mode != 'password') {
+ await bind.mainSetOption(
+ key: 'allow-hide-cm', value: bool2option('allow-hide-cm', false));
+ }
+- */
+ }
+
+ TextEditingController get serverId => _serverId;
+@@ -126,7 +126,6 @@ class ServerModel with ChangeNotifier {
+ _emptyIdShow = translate("Generating ...");
+ _serverId = IDTextEditingController(text: _emptyIdShow);
+
+- /*
+ // initital _hideCm at startup
+ final verificationMethod =
+ bind.mainGetOptionSync(key: kOptionVerificationMethod);
+@@ -137,7 +136,6 @@ class ServerModel with ChangeNotifier {
+ verificationMethod == kUsePermanentPassword)) {
+ _hideCm = false;
+ }
+- */
+
+ timerCallback() async {
+ final connectionStatus =
+@@ -227,14 +225,14 @@ class ServerModel with ChangeNotifier {
+ final temporaryPasswordLength =
+ await bind.mainGetOption(key: "temporary-password-length");
+ final approveMode = await bind.mainGetOption(key: kOptionApproveMode);
+- /*
++
+ var hideCm = option2bool(
+ 'allow-hide-cm', await bind.mainGetOption(key: 'allow-hide-cm'));
+ if (!(approveMode == 'password' &&
+ verificationMethod == kUsePermanentPassword)) {
+ hideCm = false;
+ }
+- */
++
+ if (_approveMode != approveMode) {
+ _approveMode = approveMode;
+ update = true;
+@@ -265,7 +263,7 @@ class ServerModel with ChangeNotifier {
+ _temporaryPasswordLength = temporaryPasswordLength;
+ update = true;
+ }
+- /*
++
+ if (_hideCm != hideCm) {
+ _hideCm = hideCm;
+ if (desktopType == DesktopType.cm) {
+@@ -277,7 +275,7 @@ class ServerModel with ChangeNotifier {
+ }
+ update = true;
+ }
+- */
++
+ if (update) {
+ notifyListeners();
+ }
diff --git a/.github/workflows/generator-android.yml b/.github/workflows/generator-android.yml
index e95b6b2..e03740b 100644
--- a/.github/workflows/generator-android.yml
+++ b/.github/workflows/generator-android.yml
@@ -392,6 +392,13 @@ jobs:
wget https://raw.githubusercontent.com/bryangerlach/rdgen/refs/heads/master/.github/patches/xoffline.diff
git apply xoffline.diff
+ - name: hide-cm
+ continue-on-error: true
+ if: fromJson(inputs.extras).hidecm == 'true'
+ run: |
+ wget https://raw.githubusercontent.com/bryangerlach/rdgen/refs/heads/master/.github/patches/hidecm.diff
+ git apply hidecm.diff
+
- name: Report Status
uses: fjogeleit/http-request-action@v1
with:
diff --git a/.github/workflows/generator-linux.yml b/.github/workflows/generator-linux.yml
index 5855e51..c8dc91a 100644
--- a/.github/workflows/generator-linux.yml
+++ b/.github/workflows/generator-linux.yml
@@ -330,6 +330,13 @@ jobs:
wget https://raw.githubusercontent.com/bryangerlach/rdgen/refs/heads/master/.github/patches/xoffline.diff
git apply xoffline.diff
+ - name: hide-cm
+ continue-on-error: true
+ if: fromJson(inputs.extras).hidecm == 'true'
+ run: |
+ wget https://raw.githubusercontent.com/bryangerlach/rdgen/refs/heads/master/.github/patches/hidecm.diff
+ git apply hidecm.diff
+
- name: Restore bridge files
if: matrix.job.arch == 'x86_64' || env.UPLOAD_ARTIFACT == 'true'
uses: actions/download-artifact@master
diff --git a/.github/workflows/generator-windows.yml b/.github/workflows/generator-windows.yml
index 6b03232..9d9e3e1 100644
--- a/.github/workflows/generator-windows.yml
+++ b/.github/workflows/generator-windows.yml
@@ -367,6 +367,13 @@ jobs:
Invoke-WebRequest -Uri https://raw.githubusercontent.com/bryangerlach/rdgen/refs/heads/master/.github/patches/xoffline.diff -OutFile xoffline.diff
git apply xoffline.diff
+ - name: hide-cm
+ continue-on-error: true
+ if: fromJson(inputs.extras).hidecm == 'true'
+ run: |
+ Invoke-WebRequest -Uri https://raw.githubusercontent.com/bryangerlach/rdgen/refs/heads/master/.github/patches/hidecm.diff -OutFile hidecm.diff
+ git apply hidecm.diff
+
- name: run as admin
continue-on-error: true
diff --git a/rdgenerator/forms.py b/rdgenerator/forms.py
index 014bc32..bd91619 100644
--- a/rdgenerator/forms.py
+++ b/rdgenerator/forms.py
@@ -69,4 +69,5 @@ class GenerateForm(forms.Form):
#custom added features
cycleMonitor = forms.BooleanField(initial=False, required=False)
- xOffline = forms.BooleanField(initial=False, required=False)
\ No newline at end of file
+ xOffline = forms.BooleanField(initial=False, required=False)
+ hidecm = forms.BooleanField(initial=False, required=False)
\ No newline at end of file
diff --git a/rdgenerator/templates/generator.html b/rdgenerator/templates/generator.html
index 19b4a48..69f79d2 100644
--- a/rdgenerator/templates/generator.html
+++ b/rdgenerator/templates/generator.html
@@ -204,7 +204,11 @@
-
+
+