Skip to content

Commit 7e9e38f

Browse files
spencercwgnif
authored andcommitted
[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.
1 parent 0fd6f59 commit 7e9e38f

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

client/src/overlay/status.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ static int status_render(void * udata, bool interactive, struct Rect * windowRec
8989
};
9090

9191
int xPos = screen->x - marginX;
92+
bool show = false;
9293
for(int i = 0; i < LG_USER_STATUS_MAX; ++i)
9394
{
9495
OverlayImage * img = &l_image[i];
@@ -99,6 +100,8 @@ static int status_render(void * udata, bool interactive, struct Rect * windowRec
99100
if (i == LG_USER_STATUS_RECORDING && !l_recordToggle)
100101
goto next;
101102

103+
show = true;
104+
102105
ImDrawList_AddImage(
103106
igGetBackgroundDrawList_Nil(),
104107
img->tex,
@@ -118,6 +121,9 @@ static int status_render(void * udata, bool interactive, struct Rect * windowRec
118121
xPos -= ICON_SIZE + gapX;
119122
}
120123

124+
if (!show)
125+
return 0;
126+
121127
*windowRects = rect;
122128
return 1;
123129
}

0 commit comments

Comments
 (0)