mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-05-28 07:29:09 +00:00
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:
parent
9f7eb6c4c1
commit
5b8ca05f1a
7 changed files with 279 additions and 73 deletions
|
@ -2000,6 +2000,32 @@ extern "C" {
|
|||
*/
|
||||
#define SDL_HINT_VIDEO_WAYLAND_MODE_SCALING "SDL_VIDEO_WAYLAND_MODE_SCALING"
|
||||
|
||||
/**
|
||||
* A variable forcing non-DPI-aware Wayland windows to output at 1:1 scaling.
|
||||
*
|
||||
* When this hint is set, Wayland windows that are not flagged as being DPI-aware will be
|
||||
* output with scaling designed to force 1:1 pixel mapping.
|
||||
*
|
||||
* This is intended to allow legacy applications to be displayed without desktop scaling
|
||||
* being applied, and has issues with certain display configurations, as this forces the
|
||||
* window to behave in a way that Wayland desktops were not designed to accommodate:
|
||||
*
|
||||
* - Rounding errors can result with odd window sizes and/or desktop scales.
|
||||
* - The window may be unusably small.
|
||||
* - The window may jump in size at times.
|
||||
* - The window may appear to be larger than the desktop size to the application.
|
||||
* - Possible loss of cursor precision.
|
||||
*
|
||||
* New applications should be designed with proper DPI awareness handling instead of enabling this.
|
||||
*
|
||||
* This variable can be set to the following values:
|
||||
* "0" - Windows will be scaled normally.
|
||||
* "1" - Windows will be forced to scale to achieve 1:1 output.
|
||||
*
|
||||
* By default, scaling to the display is disabled.
|
||||
*/
|
||||
#define SDL_HINT_VIDEO_WAYLAND_SCALE_TO_DISPLAY "SDL_VIDEO_WAYLAND_SCALE_TO_DISPLAY"
|
||||
|
||||
/**
|
||||
* Enable or disable mouse pointer warp emulation, needed by some older games.
|
||||
*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue