Fix monitor selection: resolve /f and /monitors: parameter conflict

Root cause: /f (fullscreen) parameter conflicts with /monitors: in FreeRDP 2.11.5
causing specific monitor selection to fall back to single monitor display.

Changes:
- Reorder command generation to check monitor config before resolution
- Skip /f when using specific monitor selection (/monitors:1,2 or /monitors:1,2,0)
- Keep /f only for 'All Monitors' and single monitor scenarios
- Add test script to validate new command generation logic

This should fix the issue where:
- 'All Monitors' works correctly (uses /f + /multimon)
- '2 Monitors' and '3 Monitors' were showing only 1 monitor

Expected result: /monitors:1,2 without /f should now properly display on 2 monitors
This commit is contained in:
root
2025-09-18 11:01:39 +02:00
parent 87598da623
commit e727430a4f
2 changed files with 97 additions and 5 deletions

View File

@@ -842,10 +842,17 @@ Multi-Monitor Support:
if conn.get("domain"):
cmd.append(f"/d:{conn['domain']}")
# Resolution
# Check monitor configuration first to determine resolution handling
multimon = conn.get("multimon", "No")
use_specific_monitors = multimon in ["2 Monitors", "3 Monitors", "4 Monitors"]
# Resolution - avoid /f with specific monitor selection due to conflicts
resolution = conn.get("resolution", "1920x1080")
if resolution == "Full Screen":
if resolution == "Full Screen" and not use_specific_monitors:
cmd.append("/f")
elif resolution == "Full Screen" and use_specific_monitors:
# Don't use /f with specific monitors - let /monitors: determine the layout
self.logger.info("Skipping /f (fullscreen) due to specific monitor selection")
else:
cmd.append(f"/size:{resolution}")
@@ -853,11 +860,9 @@ Multi-Monitor Support:
color_depth = conn.get("color_depth", 32)
cmd.append(f"/bpp:{color_depth}")
# Multiple monitors
multimon = conn.get("multimon", "No")
# Multiple monitors - use /monitors: without /multimon for specific selection
if multimon == "2 Monitors":
monitor_list = self._get_best_monitor_selection(2)
# Try using /monitors without /multimon for specific monitor selection
cmd.append(f"/monitors:{monitor_list}")
self.logger.info(f"Using specific monitors for 2 monitors: {monitor_list}")
elif multimon == "3 Monitors":