From 80fd3dde3630a39b57ee9a9ea376368664dbd154 Mon Sep 17 00:00:00 2001 From: root Date: Thu, 18 Sep 2025 11:12:01 +0200 Subject: [PATCH] Remove /size: parameter conflict with /monitors: for better compatibility Issue: /monitors:1,2 with /size:3840x1080 still shows only single monitor Analysis: /size: parameter may conflict with /monitors: in FreeRDP 2.11.5 New approach: - Use /monitors:1,2 WITHOUT /size: parameter - Let /monitors: parameter handle monitor layout and sizing automatically - Remove /size: from command when using specific monitor selection - Keep /size: only for single monitor or manual resolution settings Expected behavior: - /monitors:1,2 should automatically span across monitors 1,2 - Remove potential parameter conflicts causing single monitor fallback - Maintain fullscreen-like behavior through monitor spanning Test command change: Before: xfreerdp /size:3840x1080 /monitors:1,2 After: xfreerdp /monitors:1,2 This follows FreeRDP documentation that /monitors: should handle sizing. --- rdp_client.py | 10 +++++-- test_new_monitor_approach.py | 53 ++++++++++++++++++++++++++++++++++++ 2 files changed, 61 insertions(+), 2 deletions(-) create mode 100644 test_new_monitor_approach.py diff --git a/rdp_client.py b/rdp_client.py index 2f9beeb..a50f178 100755 --- a/rdp_client.py +++ b/rdp_client.py @@ -917,10 +917,16 @@ Multi-Monitor Support: color_depth = conn.get("color_depth", 32) cmd.append(f"/bpp:{color_depth}") - # Multiple monitors - use /monitors: for specific selection + # Multiple monitors - try different approaches for better compatibility if use_specific_monitors: + # Method 1: Try /monitors: without /size for better compatibility cmd.append(f"/monitors:{monitor_list}") - self.logger.info(f"Using specific monitors for {multimon}: {monitor_list}") + self.logger.info(f"Using specific monitors for {multimon}: {monitor_list} (Method 1: /monitors: only)") + + # Remove the /size: parameter we added earlier - let /monitors: handle sizing + cmd = [x for x in cmd if not x.startswith('/size:')] + self.logger.info("Removed /size: parameter to avoid conflict with /monitors:") + elif multimon == "All Monitors": cmd.append("/multimon") self.logger.info("Using all available monitors") diff --git a/test_new_monitor_approach.py b/test_new_monitor_approach.py new file mode 100644 index 0000000..3c49981 --- /dev/null +++ b/test_new_monitor_approach.py @@ -0,0 +1,53 @@ +#!/usr/bin/env python3 + +def test_new_monitor_approach(): + print("=== Testing New Monitor Approach ===") + print() + + # Simulate the command building process + cmd = ["xfreerdp", "/v:test-server", "/u:testuser", "/p:password"] + + # Test scenario: 2 Monitors with Full Screen + multimon = "2 Monitors" + resolution = "Full Screen" + use_specific_monitors = multimon in ["2 Monitors", "3 Monitors", "4 Monitors"] + monitor_list = "1,2" # Simulated result + + print(f"Testing: {multimon} with {resolution}") + print(f"Monitor list: {monitor_list}") + print() + + # Original resolution handling + if resolution == "Full Screen" and not use_specific_monitors: + cmd.append("/f") + print("Step 1: Added /f") + elif resolution == "Full Screen" and use_specific_monitors: + combined_res = "3840x1080" # Simulated calculation + cmd.append(f"/size:{combined_res}") + print(f"Step 1: Added /size:{combined_res}") + else: + cmd.append(f"/size:{resolution}") + print(f"Step 1: Added /size:{resolution}") + + cmd.append("/bpp:32") + print("Step 2: Added /bpp:32") + + # New monitor handling approach + if use_specific_monitors: + cmd.append(f"/monitors:{monitor_list}") + print(f"Step 3: Added /monitors:{monitor_list}") + + # Remove /size: to avoid conflicts + cmd = [x for x in cmd if not x.startswith('/size:')] + print("Step 4: Removed /size: parameter to avoid conflict") + + print() + print("Final command:") + cmd_str = ' '.join(cmd).replace("/p:password", "/p:***") + print(cmd_str) + print() + print("Expected behavior: /monitors:1,2 should span across monitors 1 and 2") + print("without /size: interference") + +if __name__ == "__main__": + test_new_monitor_approach() \ No newline at end of file