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.
This commit is contained in:
@@ -917,10 +917,16 @@ Multi-Monitor Support:
|
|||||||
color_depth = conn.get("color_depth", 32)
|
color_depth = conn.get("color_depth", 32)
|
||||||
cmd.append(f"/bpp:{color_depth}")
|
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:
|
if use_specific_monitors:
|
||||||
|
# Method 1: Try /monitors: without /size for better compatibility
|
||||||
cmd.append(f"/monitors:{monitor_list}")
|
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":
|
elif multimon == "All Monitors":
|
||||||
cmd.append("/multimon")
|
cmd.append("/multimon")
|
||||||
self.logger.info("Using all available monitors")
|
self.logger.info("Using all available monitors")
|
||||||
|
|||||||
53
test_new_monitor_approach.py
Normal file
53
test_new_monitor_approach.py
Normal file
@@ -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()
|
||||||
Reference in New Issue
Block a user