steamcompmgr: Treat video underlay as a base plane if we have it -- otherwise treat the focus window as one when streaming

Fixes a case where we can get 0 layers.
This commit is contained in:
Joshua Ashton 2021-12-17 08:52:01 +00:00 committed by Pierre-Loup A. Griffais
parent 589fd61d58
commit 6f284f2cce

View file

@ -1478,26 +1478,32 @@ paint_all(Display *dpy, MouseCursor *cursor)
if ( w->isSteamStreamingClient == true )
{
win *videow = NULL;
bool bHasVideoUnderlay = false;
for ( videow = list; videow; videow = videow->next )
{
if ( videow->isSteamStreamingClientVideo == true )
{
// TODO: also check matching AppID so we can have several pairs
bValidContents |= paint_window(dpy, videow, videow, &composite, &pipeline, false, cursor);
bValidContents |= paint_window(dpy, videow, videow, &composite, &pipeline, false, cursor, true);
bHasVideoUnderlay = true;
break;
}
}
bool bOldValidContents = bValidContents;
int nOldLayerCount = composite.nLayerCount;
bValidContents |= paint_window(dpy, w, w, &composite, &pipeline, false, cursor);
bValidContents |= paint_window(dpy, w, w, &composite, &pipeline, false, cursor, !bHasVideoUnderlay);
update_touch_scaling( &composite );
// paint UI unless it's fully hidden, which it communicates to us through opacity=0
// we paint it to extract scaling coefficients above, then remove the layer if one was added
if ( w->opacity == TRANSLUCENT && nOldLayerCount < composite.nLayerCount )
if ( w->opacity == TRANSLUCENT && bHasVideoUnderlay && nOldLayerCount < composite.nLayerCount )
{
composite.nLayerCount--;
bValidContents = bOldValidContents;
}
}
else
{