wayland: Add a forced screen space scaling mode

Add a mode that forces Wayland windows to output with scaling that forces 1:1 pixel mapping.

This is intended to allow legacy applications to be displayed without desktop scaling being applied, and may have issues with some display configurations, as this forces the window to behave in a way that Wayland desktops were not designed to accommodate (rounding errors can result from certain combinations of window/scale values, the window may be unusably small, jump in size at times, or appear to be larger than the desktop space, and cursor precision may be reduced).

Windows flagged as DPI-aware are not affected by this.

The automated video test suite passes with the hint turned on.
This commit is contained in:
Frank Praznik
2024-01-19 10:30:07 -05:00
parent 9f7eb6c4c1
commit 5b8ca05f1a
7 changed files with 279 additions and 73 deletions

View File

@@ -6,6 +6,14 @@ encounter limitations or behavior that is different from other windowing systems
## Common issues:
### Legacy, DPI-unaware applications are blurry
- Wayland handles high-DPI displays by scaling the desktop, which causes applications that are not designed to be
DPI-aware to be automatically scaled by the window manager, which results in them being blurry. SDL can _attempt_ to
scale these applications such that they will be output with a 1:1 pixel aspect, however this may be buggy, especially
with odd-sized windows and/or scale factors that aren't quarter-increments (125%, 150%, etc...). To enable this, set
the environment variable `SDL_HINT_VIDEO_WAYLAND_SCALE_TO_DISPLAY=1`
### Window decorations are missing, or the decorations look strange
- On some desktops (i.e. GNOME), Wayland applications use a library