src/wlserver.cpp:430:16: warning: comparison of integers of different signs: 'long' and 'uint32_t' (aka 'unsigned int') [-Wsign-compare]
if (s->wl_id == id && s->wlr == nullptr)
~~~~~~~~ ^ ~~
src/drm.cpp:187:50: warning: format specifies type 'unsigned long' but the argument has type 'uint64_t' (aka 'unsigned long long') [-Wformat]
drm_verbose_log.debugf("page_flip_handler %lu", flipcount);
~~~ ^~~~~~~~~
%llu
src/drm.cpp:777:44: warning: format specifies type 'unsigned long' but the argument has type 'uint64_t' (aka 'unsigned long long') [-Wformat]
drm_verbose_log.debugf("flip commit %lu", (uint64_t)g_DRM.flipcount);
~~~ ^~~~~~~~~~~~~~~~~~~~~~~~~
%llu
This side-steps wlr_client_buffer and ensures we get access to the
underlying buffer. This allows us to call
wlr_buffer_begin_data_ptr_access to upload shm textures.
Initialize Vulkan first to pick a physical device, then initialize
DRM or SDL. That way, DRM can open its own device depending on what
Vulkan is using. This avoids picking the wrong GPU on multi-GPU
setups.
This required rejiggering how initialization happens. In particular,
we need to get the SDL Vulkan instance extension list early. This is
supported since SDL 2.0.9 (by omitting the window in
SDL_Vulkan_GetInstanceExtensions).
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>