REMINDER: This is specifically with regards to external displays, not internal laptop or tablet displays (on such internal displays, the xrandr method will "just work" even on Intel graphics). Furthermore, some external displays, primarily TVs (but some monitors as well), have their own built-in aspect ratio control which negates the need for GPU-based aspect ratio preservation (same goes for if you're using a CRT which needs no scaling at all).
UPDATE 2: If you're on Intel graphics (it works on AMD as well, but simply using the xrandr method below has much better compatibility unless you specifically want to use AMD FSR scaling), then the best solution may be to use Gamescope since, when you set Gamescope itself to fullscreen, it basically forces your desired program to run in "borderless window" style of fullscreen scaled up to your current desktop resolution with the aspect ratio preserved.
Running software through gamescope is simple enough by just doing the following:
Code: Select all
gamescope [insert terminal arguments HERE] -- [insert normal terminal commands to launch whatever program HERE]
Code: Select all
gamescope -f -- wine true.exe
Do note however that Gamescope is not perfect and (currently) may have difficulty with auto-hidden menus and the like such as used by True Remembrance. Furthermore, on Mint 20.3 Cinnamon, it seemed to only have like a 50% chance of even launching the software at all (if it failed to launch, I simply just had to try again until it worked).
----------------
UPDATE: The "easy" solution is to just not use Intel graphics.
On AMD graphics you can just use the following xrandr argument and everything will "just work" (if it's an older AMD GPU, you may or may not have garbled graphics if the width is the same as your monitor however, e.g. running 1280x720 on a 1280x1024 monitor):
Code: Select all
--set "scaling mode" "Full aspect"
And, on Nvidia, this function is apparently something built into their proprietary drivers:
So on my AMD A8-7600 test desktop connected to a 1280x1024 DVI monitor, I was able to use something like the following (replace
DVI-0
with whatever xrandr and/or "Display" on Cinnamon lists your current output as):Code: Select all
xrandr --output DVI-0 --set "scaling mode" "Full aspect"
Then after that, if I change my resolution to anything else whether in the "Display" application or via xrandr even without specifying a "scalling mode", it'd automatically remember to preserve the aspect ratio. The same also goes for if you run a program or game that wants to change your output desktop resolution - even then it'll still remember to preserve the aspect ratio. This even works for custom resolution greater than you monitor, effectively allowing for an easy way to run games with "downsampling" or super-sample anti-aliasing.
Just be aware that, at this time, xrandr's
--set "scaling mode"
seems to be limited to outputting at your monitor's first-listed EDID refresh which is commonly 60Hz on even higher-refreshing monitors despite the OS claiming to be running at a higher refresh rate, so you may want to keep it disabled by default and instead use a bash script to launch a given program to enable --set "scaling mode"
and then have it disable when the program is closed and then subsequently be sure to set your refresh rate back to whatever greater-than-60Hz refresh you'd normally run at.----------------------------------------------------------------
I'm using LM 20.3
I'm trying to run older software that I want to run in 640x480 and/or 800x600 in fullscreen, but my DVI-connected monitor is not 4:3. And, like many DVI monitors, the built-in scaling options on my monitor are basically non-existent and it always just stretches the displayed resolution across the entire screen without preserving the source aspect ratio (In fact, this occurs even if I just change my desktop resolution through the display options in Mint itself).
Running the software in a window is possible but a less-than-ideal solution (not to mention that a 640x480 window is quite small).
For reference, on Windows since the XP days, I could just use "GPU scaling" (even on Intel integrated graphics) to achieve the result I'm looking for, but I don't know if something like that even exists on Linux or if there's some other, non-GPU-based solution (e.g. xrandr, WINE, etc) that would similarly achieve the desired result.
(speaking of xrandr, the part about an external monitor is because I read some stuff about preserving aspect ratios via xrandr that only works on laptops and not desktop monitors)
EDIT: I'm using Intel Haswell aka 4th gen integrated graphics.