Enhance monitor selection with advanced debugging and logging

- Improved monitor detection with primary/secondary identification
- Enhanced logging to track monitor layout and selection process
- Added comprehensive debug scripts for troubleshooting monitor issues
- Better error handling in monitor selection logic
- Created test utilities for validating monitor selection behavior

Debug tools added:
- debug_monitor_issue.sh: Comprehensive monitor debugging script
- test_enhanced_monitor.py: Tests monitor selection logic with logging
- debug_rdp_command.py: Tests RDP command generation

Fixes:
- Monitor detection now identifies primary monitor correctly
- Detailed logging shows exactly which monitors are selected
- Better fallback handling for monitor detection errors
- Enhanced command logging for easier troubleshooting
This commit is contained in:
root
2025-09-18 10:55:34 +02:00
parent 9fc22b2b97
commit 87598da623
4 changed files with 244 additions and 7 deletions

46
debug_monitor_issue.sh Executable file
View File

@@ -0,0 +1,46 @@
#!/bin/bash
echo "=== Monitor Selection Debugging ==="
echo "This script helps debug monitor selection issues"
echo
# Show current monitor setup
echo "1. Current monitor configuration:"
xfreerdp /monitor-list
echo
# Test different monitor parameter combinations
echo "2. Testing different xfreerdp monitor parameters:"
echo
echo "Testing /monitors:1,2 (should use monitors 1 and 2):"
echo "Command: xfreerdp /monitor-list /monitors:1,2"
echo "Note: This would be used for '2 Monitors' selection"
echo
echo "Testing /monitors:1,2,0 (should use monitors 1, 2, and 0):"
echo "Command: xfreerdp /monitor-list /monitors:1,2,0"
echo "Note: This would be used for '3 Monitors' selection"
echo
echo "Testing /multimon (should use all monitors):"
echo "Command: xfreerdp /monitor-list /multimon"
echo "Note: This would be used for 'All Monitors' selection"
echo
echo "3. To test with actual RDP connection, you can use:"
echo "xfreerdp /v:your-server /u:username /p:password /monitors:1,2"
echo
echo "If /monitors:1,2 still uses only one monitor, this indicates"
echo "a limitation or bug in your FreeRDP version (2.11.5)"
echo
echo "4. Alternative workarounds to try:"
echo "- Use /multimon instead of /monitors: (uses all monitors)"
echo "- Use /span to span across monitors"
echo "- Update to a newer version of FreeRDP"
echo "- Check if your RDP server supports multi-monitor"
echo
echo "5. Check current RDP client logs:"
echo "tail -20 ~/.config/rdp-client/rdp_client.log"