Skip to content

Commit

Permalink
steamcompmgr: Add GAMESCOPE_DISPLAY_REFRESH_RATE_FEEDBACK
Browse files Browse the repository at this point in the history
  • Loading branch information
misyltoad committed Nov 7, 2023
1 parent 10d28b9 commit 711285a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/steamcompmgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,7 @@ bool g_bSupportsST2084_CachedValue = false;
bool g_bForceHDR10OutputDebug = false;
bool g_bHDREnabled = false;
bool g_bHDRItmEnable = false;
int g_nCurrentRefreshRate_CachedValue = 0;

static void
update_color_mgmt()
Expand Down Expand Up @@ -7082,6 +7083,8 @@ void init_xwayland_ctx(uint32_t serverId, gamescope_xwayland_server_t *xwayland_
ctx->atoms.gamescopeReshadeEffect = XInternAtom( ctx->dpy, "GAMESCOPE_RESHADE_EFFECT", false );
ctx->atoms.gamescopeReshadeTechniqueIdx = XInternAtom( ctx->dpy, "GAMESCOPE_RESHADE_TECHNIQUE_IDX", false );

ctx->atoms.gamescopeDisplayRefreshRateFeedback = XInternAtom( ctx->dpy, "GAMESCOPE_DISPLAY_REFRESH_RATE_FEEDBACK", false );

ctx->atoms.wineHwndStyle = XInternAtom( ctx->dpy, "_WINE_HWND_STYLE", false );
ctx->atoms.wineHwndStyleEx = XInternAtom( ctx->dpy, "_WINE_HWND_EXSTYLE", false );

Expand Down Expand Up @@ -7191,6 +7194,15 @@ void update_vrr_atoms(xwayland_ctx_t *root_ctx, bool force, bool* needs_flush =
*needs_flush = true;
}

if ( g_nOutputRefresh != g_nCurrentRefreshRate_CachedValue || force )
{
XChangeProperty(root_ctx->dpy, root_ctx->root, root_ctx->atoms.gamescopeDisplayRefreshRateFeedback, XA_CARDINAL, 32, PropModeReplace,
(unsigned char *)&g_nOutputRefresh, 1 );
g_nCurrentRefreshRate_CachedValue = g_nOutputRefresh;
if (needs_flush)
*needs_flush = true;
}

// Don't update this in-sync with DRM vrr usage.
// Keep this as a preference, starting with off.
if ( force )
Expand Down
2 changes: 2 additions & 0 deletions src/xwayland_ctx.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,8 @@ struct xwayland_ctx_t
Atom gamescopeReshadeEffect;
Atom gamescopeReshadeTechniqueIdx;

Atom gamescopeDisplayRefreshRateFeedback;

Atom wineHwndStyle;
Atom wineHwndStyleEx;

Expand Down

0 comments on commit 711285a

Please sign in to comment.