From 3e14ef9c37266b19ba77fbef467d1b8a77d827f2 Mon Sep 17 00:00:00 2001 From: Joshua Ashton Date: Wed, 13 Dec 2023 02:14:32 +0000 Subject: [PATCH] layer: Add GAMESCOPE_WSI_FORCE_BYPASS --- layer/VkLayer_FROG_gamescope_wsi.cpp | 11 +++++++++++ src/layer_defines.h | 1 + 2 files changed, 12 insertions(+) diff --git a/layer/VkLayer_FROG_gamescope_wsi.cpp b/layer/VkLayer_FROG_gamescope_wsi.cpp index c08caa2e7..946f53802 100644 --- a/layer/VkLayer_FROG_gamescope_wsi.cpp +++ b/layer/VkLayer_FROG_gamescope_wsi.cpp @@ -92,6 +92,10 @@ namespace GamescopeWSILayer { static GamescopeLayerClient::Flags defaultLayerClientFlags(uint32_t appid) { GamescopeLayerClient::Flags flags = 0; + const char *bypassEnv = getenv("GAMESCOPE_WSI_FORCE_BYPASS"); + if (bypassEnv && *bypassEnv && atoi(bypassEnv) != 0) + flags |= GamescopeLayerClient::Flag::ForceBypass; + // My Little Pony: A Maretime Bay Adventure picks a HDR colorspace if available, // but does not render as HDR at all. if (appid == 1600780) @@ -169,6 +173,13 @@ namespace GamescopeWSILayer { return false; } + // Some games do things like have a 1280x800 top-level window and + // a 1280x720 child window for "fullscreen". + // To avoid Glamor work on the XWayland side of things, have a + // flag to force bypassing this. + if (!!(flags & GamescopeLayerClient::Flag::ForceBypass)) + return true; + // If we have any child windows obscuring us bigger than 1x1, // then we cannot flip. // (There can be dummy composite redirect windows and whatever.) diff --git a/src/layer_defines.h b/src/layer_defines.h index fb34465a9..ef9a10792 100644 --- a/src/layer_defines.h +++ b/src/layer_defines.h @@ -8,6 +8,7 @@ namespace GamescopeLayerClient // GAMESCOPE_LAYER_CLIENT_FLAGS namespace Flag { static constexpr uint32_t DisableHDR = 1u << 0; + static constexpr uint32_t ForceBypass = 1u << 1; } using Flags = uint32_t; } \ No newline at end of file