[client] overlay/status: don't return damage rect if nothing was drawn

The renderer contains an optimization to skip ImGui if there is nothing to
show, but the status overlay always returns a damage rect, even if it
didn't draw anything, so the optimization can never take effect.
This commit is contained in:
Chris Spencer 2025-02-11 15:51:04 +00:00 committed by Geoffrey McRae
parent 0fd6f59bbb
commit 7e9e38faa5

View File

@ -89,6 +89,7 @@ static int status_render(void * udata, bool interactive, struct Rect * windowRec
};
int xPos = screen->x - marginX;
bool show = false;
for(int i = 0; i < LG_USER_STATUS_MAX; ++i)
{
OverlayImage * img = &l_image[i];
@ -99,6 +100,8 @@ static int status_render(void * udata, bool interactive, struct Rect * windowRec
if (i == LG_USER_STATUS_RECORDING && !l_recordToggle)
goto next;
show = true;
ImDrawList_AddImage(
igGetBackgroundDrawList_Nil(),
img->tex,
@ -118,6 +121,9 @@ next:
xPos -= ICON_SIZE + gapX;
}
if (!show)
return 0;
*windowRects = rect;
return 1;
}