mirror of
https://github.com/gnif/LookingGlass.git
synced 2025-06-30 16:49:50 +00:00
[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:
parent
0fd6f59bbb
commit
7e9e38faa5
@ -89,6 +89,7 @@ static int status_render(void * udata, bool interactive, struct Rect * windowRec
|
|||||||
};
|
};
|
||||||
|
|
||||||
int xPos = screen->x - marginX;
|
int xPos = screen->x - marginX;
|
||||||
|
bool show = false;
|
||||||
for(int i = 0; i < LG_USER_STATUS_MAX; ++i)
|
for(int i = 0; i < LG_USER_STATUS_MAX; ++i)
|
||||||
{
|
{
|
||||||
OverlayImage * img = &l_image[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)
|
if (i == LG_USER_STATUS_RECORDING && !l_recordToggle)
|
||||||
goto next;
|
goto next;
|
||||||
|
|
||||||
|
show = true;
|
||||||
|
|
||||||
ImDrawList_AddImage(
|
ImDrawList_AddImage(
|
||||||
igGetBackgroundDrawList_Nil(),
|
igGetBackgroundDrawList_Nil(),
|
||||||
img->tex,
|
img->tex,
|
||||||
@ -118,6 +121,9 @@ next:
|
|||||||
xPos -= ICON_SIZE + gapX;
|
xPos -= ICON_SIZE + gapX;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!show)
|
||||||
|
return 0;
|
||||||
|
|
||||||
*windowRects = rect;
|
*windowRects = rect;
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user