Make the SDL window honour monitor, --monitor and --list-monitors.

On Linux the window ignored NX2NAVI_MONITOR (the log said it had no effect) and --list-monitors only printed that monitor selection is Win32-only. The SDL window now picks a monitor with the same rules as the Win32 one: auto (the system places it), primary, a 1-based index in listing order, or part of the monitor's name, ignoring case, the first match in list order winning. The monitors are SDL's displays; --list-monitors prints their index, name (the make and model, with the connector on Wayland and X11), pixel size and position, primary flag and display scale, then what NX2NAVI_MONITOR would pick, and the log says the same when the window opens.

The window is created centred on the chosen monitor and centred again at its final size, and that position also names the display the fullscreen setting covers, which is how a Wayland window, which a client cannot move, opens fullscreen on the chosen output. On Wayland a windowed window opens where the compositor puts it; the log says so once. With a chosen monitor, the size widescreen.c reads for fullscreen before the window exists is that monitor's.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Michael Schienbein
2026-11-09 12:31:25 -06:00
committed by chrg6
parent 4d41188d8b
commit a103673341
5 changed files with 225 additions and 31 deletions

View File

@@ -223,9 +223,11 @@
# fullscreen = 0
# Which monitor the game window opens on, centred in its work area; fullscreen covers that monitor. auto (default): the
# system places the window. primary; a number, counting from 1 in the order `nx2navi.exe --list-monitors` prints; or part
# of a GDI device name (display3) or of the monitor's name, ignoring case. For a virtual display that may not exist yet,
# use its name: when nothing matches, the log lists the monitors and the window is placed as with auto. The command line
# `--monitor <value>` overrides this for one run. Read at start; Windows only.
# of the monitor's name, ignoring case (on Windows also of a GDI device name, display3; on Linux the name carries the
# connector, such as dp-2). For a virtual display that may not exist yet, use its name: when nothing matches, the log
# lists the monitors and the window is placed as with auto. The command line `--monitor <value>` overrides this for one
# run. Read at start. On Wayland a window cannot place itself: only fullscreen opens on the chosen monitor, and a
# windowed window opens where the compositor puts it.
# monitor = auto
# 1, the default: the game keeps running while you are in another window; the keyboard stays quiet until the window is
# in front again. 0: it pauses when its window loses focus, as it does on the Switch when Home is pressed; a load