g_nOutput* stored two different values: preferred values taken from
the CLI at init-time, then current values after init. This results
in some tricky logic because depending on when code is executed it'd
access one or the other.
Introduce two separate sets of variables instead. DRM reads from the
preferred values, decides which DRM mode to enable, then writes to
the current values. SDL reads from the preferred values and makes
them current immediately.
This changes gamescope's behaviour so that native DRM modes are
picked when -w/-h isn't specified on the command line. When -w/-h are
specified, the DRM logic will try to pick a mode which matches.
When nested, the default output size still defaults to 720p, but
changes when the user resizes the window.
Closes: https://github.com/Plagman/gamescope/issues/258
When gamescope has cap_sys_nice capability, then `secure_getenv` used
by libxkbcommon does not load the keymap configuration from
environment. So the environment variables have to be manually read from
gamescope.
Without `XKB_DEFAULT_LAYOUT` it is not possible to load other keymaps
than US.
Absorb 5 moves for auto-hide purposes instead of 3. Our nudge is 2 moves,
and we can warp on top of that, so we weren't counting everything.
Hide before changing mouse input focus and the warp that ensues.
Re-arm warp count when changing mouse input focus, so doing it repeatedly
with the same window doesn't eventually unhide despite no input.
Technically, YCbCr has a hard requirement of everything being CLAMP_TO_EDGE here and validation moans about it. Better just to set it.
Signed-off-by: Joshua Ashton <joshua@froggi.es>
We can't use normal border colors if we are doing linear filtering as we will sample slightly outside on the edges and blend to the border color.
Replace this with a way to push an arbitrary layer alpha and return that in the OOB case, and when sampling, clamp to edge.
This also may be more efficient to avoid sampling OOB a lot of the time in some cases.
Signed-off-by: Joshua Ashton <joshua@froggi.es>
Allows us to use this as a Meson subproject which means that recursive cloning doesn't matter (Meson resolves it for subprojects).
Given this subproject doesn't have a meson file, doing subproject() on it would fail, so:
Make a wrap file with an overlay that declares a proper dependency.
Signed-off-by: Joshua Ashton <joshua@froggi.es>