From 6f284f2cce1232a7b1b4d8342e4f0ee9b05560be Mon Sep 17 00:00:00 2001 From: Joshua Ashton Date: Fri, 17 Dec 2021 08:52:01 +0000 Subject: [PATCH] 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. --- src/steamcompmgr.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/steamcompmgr.cpp b/src/steamcompmgr.cpp index 18effcf..2a34504 100644 --- a/src/steamcompmgr.cpp +++ b/src/steamcompmgr.cpp @@ -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 {