steamcompmgr: Add GAMESCOPE_HDR_OUTPUT_FEEDBACK

Exposes whether HDR output is currently enabled.
This commit is contained in:
Joshua Ashton 2022-12-20 16:22:08 +00:00 committed by Joshie
parent 1ab8757558
commit acf76d6cff
2 changed files with 13 additions and 0 deletions

View file

@ -5395,6 +5395,7 @@ void init_xwayland_ctx(gamescope_xwayland_server_t *xwayland_server)
ctx->atoms.gamescopeDisplayHDREnabled = XInternAtom( ctx->dpy, "GAMESCOPE_DISPLAY_HDR_ENABLED", false );
ctx->atoms.gamescopeDisplayHDRForceWideGammutForSDR = XInternAtom( ctx->dpy, "GAMESCOPE_DISPLAY_HDR_FORCE_WIDE_GAMMUT_FOR_SDR", false );
ctx->atoms.gamescopeDebugForceHDR10OutputSupport = XInternAtom( ctx->dpy, "GAMESCOPE_DEBUG_FORCE_HDR10_OUTPUT_SUPPORT", false );
ctx->atoms.gamescopeHDROutputFeedback = XInternAtom( ctx->dpy, "GAMESCOPE_HDR_OUTPUT_FEEDBACK", false );
ctx->atoms.wineHwndStyle = XInternAtom( ctx->dpy, "_WINE_HWND_STYLE", false );
ctx->atoms.wineHwndStyleEx = XInternAtom( ctx->dpy, "_WINE_HWND_EXSTYLE", false );
@ -5825,6 +5826,17 @@ steamcompmgr_main(int argc, char **argv)
vulkan_remake_output_images();
}
{
gamescope_xwayland_server_t *server = NULL;
for (size_t i = 0; (server = wlserver_get_xwayland_server(i)); i++)
{
uint32_t hdr_value = g_bOutputHDREnabled ? 1 : 0;
XChangeProperty(root_ctx->dpy, root_ctx->root, root_ctx->atoms.gamescopeHDROutputFeedback, XA_CARDINAL, 32, PropModeReplace,
(unsigned char *)&hdr_value, 1 );
}
}
currentOutputWidth = g_nOutputWidth;
currentOutputHeight = g_nOutputHeight;
currentHDROutput = g_bOutputHDREnabled;

View file

@ -172,6 +172,7 @@ struct xwayland_ctx_t
Atom gamescopeDisplayHDREnabled;
Atom gamescopeDisplayHDRForceWideGammutForSDR;
Atom gamescopeDebugForceHDR10OutputSupport;
Atom gamescopeHDROutputFeedback;
Atom wineHwndStyle;
Atom wineHwndStyleEx;