wayland: Add aspect-correct output for scaled modes
Add aspect-correct output of scaled video modes and a hint to control this behavior (aspect, stretch, or none). The Wayland spec states that fullscreen surfaces that do not cover the entire output shall be centered with the borders masked by the compositor, so no additional work is required aside from calculating the proper window dimensions. The default is still 'stretch' mode, as some window managers as of this time (KDE and older versions of GNOME still found in LTS distros) don't behave according to the spec and present an unmasked window that is not centered, so it's not yet safe to change the default.
This commit is contained in:
parent
4644ac99fa
commit
adad6514d4
2 changed files with 90 additions and 2 deletions
|
@ -1784,6 +1784,21 @@ extern "C" {
|
|||
*/
|
||||
#define SDL_HINT_VIDEO_WAYLAND_MODE_EMULATION "SDL_VIDEO_WAYLAND_MODE_EMULATION"
|
||||
|
||||
/**
|
||||
* \brief A variable controlling how modes with a non-native aspect ratio are displayed under Wayland.
|
||||
*
|
||||
* When this hint is set, the requested scaling will be used when displaying fullscreen video modes
|
||||
* that don't match the display's native aspect ratio. This is contingent on compositor viewport support.
|
||||
*
|
||||
* This variable can be set to the following values:
|
||||
* "aspect" - Video modes will be displayed scaled, in their proper aspect ratio, with black bars.
|
||||
* "stretch" - Video modes will be scaled to fill the entire display.
|
||||
* "none" - Video modes will be displayed as 1:1 with no scaling.
|
||||
*
|
||||
* By default 'stretch' is used.
|
||||
*/
|
||||
#define SDL_HINT_VIDEO_WAYLAND_MODE_SCALING "SDL_VIDEO_WAYLAND_MODE_SCALING"
|
||||
|
||||
/**
|
||||
* \brief Enable or disable mouse pointer warp emulation, needed by some older games.
|
||||
*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue