chore: Add touch click & 720p patch to gamescope

This commit is contained in:
Kyle Gospodnetich 2024-04-28 21:47:13 -07:00
parent 8d1b5506ec
commit b3ad634cbc
3 changed files with 45 additions and 0 deletions

View File

@ -0,0 +1,28 @@
diff --git a/src/steamcompmgr.cpp b/src/steamcompmgr.cpp
index 52dd8d1..b62c46e 100644
--- a/src/steamcompmgr.cpp
+++ b/src/steamcompmgr.cpp
@@ -140,6 +140,9 @@ extern float g_flInternalDisplayBrightnessNits;
extern float g_flHDRItmSdrNits;
extern float g_flHDRItmTargetNits;
+// define env_to_bool to point to the function in drm: remove in later patches pl0x
+extern bool env_to_bool(const char *env);
+
uint64_t g_lastWinSeq = 0;
static std::shared_ptr<gamescope::BackendBlob> s_scRGB709To2020Matrix;
@@ -5202,6 +5205,13 @@ handle_property_notify(xwayland_ctx_t *ctx, XPropertyEvent *ev)
size_t server_idx = size_t{ xwayland_mode_ctl[ 0 ] };
int width = xwayland_mode_ctl[ 1 ];
int height = xwayland_mode_ctl[ 2 ];
+
+ if ( g_nOutputWidth != 1280 && width == 1280 && !env_to_bool(getenv("GAMESCOPE_ENABLE_720P_RESTRICT")) )
+ {
+ width = g_nOutputWidth;
+ height = g_nOutputHeight;
+ }
+
bool allowSuperRes = !!xwayland_mode_ctl[ 3 ];
if ( !allowSuperRes )

View File

@ -0,0 +1,15 @@
diff --git a/src/steamcompmgr.cpp b/src/steamcompmgr.cpp
index b62c46e..ab24343 100644
--- a/src/steamcompmgr.cpp
+++ b/src/steamcompmgr.cpp
@@ -4954,7 +4954,9 @@ handle_property_notify(xwayland_ctx_t *ctx, XPropertyEvent *ev)
}
if (ev->atom == ctx->atoms.steamTouchClickModeAtom )
{
- gamescope::cv_touch_click_mode = (gamescope::TouchClickMode) get_prop(ctx, ctx->root, ctx->atoms.steamTouchClickModeAtom, 0u );
+ // When steam changes this to 1 stuff breaks, make it not shoot itself
+ // in the foot
+ //gamescope::cv_touch_click_mode = (gamescope::TouchClickMode) get_prop(ctx, ctx->root, ctx->atoms.steamTouchClickModeAtom, 0u );
}
if (ev->atom == ctx->atoms.steamStreamingClientAtom)
{

View File

@ -16,6 +16,8 @@ URL: https://github.com/ValveSoftware/gamescope
Source0: stb.pc
Patch0: hardware.patch
Patch1: 720p.patch
Patch2: disable-steam-touch-click-atom.patch
BuildRequires: meson >= 0.54.0
BuildRequires: ninja-build