2024-04-28 21:53:55 -07:00

29 lines
1002 B
Diff

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 )