-
Notifications
You must be signed in to change notification settings - Fork 822
Description
Summary
Moonlight currently relies on user-configured video modes (e.g., 1920×1080@60) and does not detect the local display’s native specs. This leads to suboptimal defaults and manual reconfiguration when users switch monitors or displays.
Feature request: add an auto-detect option that reads the active client display’s resolution, refresh rate (and HDR capability where possible) and automatically selects/suggests the closest supported streaming mode to Sunshine.
Problem
Users must manually align Moonlight’s requested resolution/refresh with their current display.
Switching between displays (1080p ↔ 1440p, 60 Hz ↔ 120/144 Hz, ultrawide, TV @ 4K120) requires manual changes.
Mismatch can cause unnecessary scaling, black bars, or degraded quality/latency.
Desired behavior
- A toggle like “Match current display”:
- Detect the display where Moonlight is rendered/fullscreened.
- Query its native mode(s): resolution, refresh rate, color space / HDR capability (where available).
Windows
Query display via DXGI or Win32:
IDXGIOutput::GetDisplayModeList / EnumDisplaySettings, GetMonitorInfo.
Determine the output the Moonlight window is on (via MonitorFromWindow), then select current mode.
Consider G-Sync/Freesync refresh availability (optional).
macOS
CoreGraphics:
CGMainDisplayID, CGGetActiveDisplayList, CGDisplayCopyDisplayMode / CGDisplayCopyAllDisplayModes.
HDR: CGColorSpace / EDR detection (if feasible).
Linux
X11: XRandR (XRRGetScreenResources, XRRGetCrtcInfo) to identify active mode for the window’s screen.
Wayland: use compositor protocols (xdg-output, wp_presentation) via the chosen Wayland toolkit bindings, fall back to logical size/refresh.