Keep aspect ratio when emulating resolution change in Xwayland
This is a follow-up on MR !270 (merged). The emulation is a great functionality, but it currently doesn't keep the original aspect ratio of the source. Since this is mostly useful for old games, it makes old 4:3 games squished and stretched on modern 16:9 screens. Characters are fat and short, and even Tetris gets weirder with rectangles instead of squares. Not to mention recent ultrawide 21:9 screens, where the picture is... really bad. I'd like to request that the aspect ratio of the source image is kept, and ideally by default (if that is rejected, please at least provide an option).
I talked to @jwrdegoede and he mentioned that it's not that simple to provide a configuration option to toggle this on/off and it's not clear how to provide a "complete story" to the user. I think I'm looking at it from a different angle, and I don't consider "complete story" to be necessary for the requested change. I'm trying to explain that in this ticket.
I'd like to provide arguments why aspect ratio should be honored by default:
- First, ignoring aspect ratio obviously breaks the image, it is no longer displayed as designed. The bigger the difference in aspect ratio, the weirded and more distorted the image is.
- Second, game emulation software, e.g. DOSBox, ScummMV, etc, default to keeping aspect ratio , and for good reasons, because retro gamers usually want to play the game as it was in the past, instead of seeing deformed art.
- Third, keeping aspect ratio is the common approach on laptop screens (at least on laptops I've owned). If you change your screen resolution to a different aspect, you simply get black bars on the sides. You have no option to change it, and nobody complains - it's obvious, because you selected a non-native resolution.
- It is true that while laptop manufacturers do a sensible thing, external monitor and TVs manufacturers often don't. On many (but not all) mainstream monitors and TVs, the default is often to stretch the image, and you have a toggle in the screen menu to honor aspect ratio instead. I believe the reason for this is economical - standard users don't use non-native resolutions too often, and when they do, they won't mind a distorted image, but they might call support if there are black bars because "there is something wrong with the screen". So it might make economical sense to have a bad default, because it saves money and advanced users will find and use the aspect ratio toggle anyway. And this is related to the next point:
- We can afford to do the right thing. We are not driven by fiscal quarter revenues or support calls costs, we don't need to race to the bottom. We can default to the technically superior solution, we can provide users with high quality image, we can educate them a little in the process.
I believe that it is completely acceptable to honor the aspect ratio by default and not provide an option to ignore the ratio. If it was acceptable to expose the functionality ignoring aspect ratio and no configuration option, it should be also acceptable to expose the functionality honoring aspect ratio and no configuration option. I see that as an improvement over the current state.
If you think there are users who'd like to fully fill their screens with a stretched image, I believe it's also completely acceptable to expose this via something very simple, like an environment variable checking. That allows the advanced users to configure this (run
XWAYLAND_RESOLUTION_ASPECT=0 mygame) and also allows third-party tools to emerge, in case general users want a GUI tool to configure this.
If my arguments weren't convincing and you intend to keep broken aspect ratios by default, I at least humbly request an option so that I can configure my games to look correctly.
 note: they have an "aspect" configuration option defaulting to off, but that is solely targeted at non-square pixels -> square pixels emulation, which can't be done without breaking the art; the aspect ratio relevant to image upscaling, as we talk about here, it always kept