diff --git a/client/include/app.h b/client/include/app.h index 8e34ede6..965874e9 100644 --- a/client/include/app.h +++ b/client/include/app.h @@ -102,6 +102,12 @@ int app_renderOverlay(struct Rect * rects, int maxRects); void app_freeOverlays(void); +/** + * invalidate the window to update the overlay, if renderTwice is set the imgui + * render code will run twice so that auto sized windows are calculated correctly + */ +void app_invalidateOverlay(bool renderTwice); + struct OverlayGraph; typedef struct OverlayGraph * GraphHandle; diff --git a/client/src/app.c b/client/src/app.c index 69753c64..84e8f768 100644 --- a/client/src/app.c +++ b/client/src/app.c @@ -622,9 +622,6 @@ void app_alert(LG_MsgAlert type, const char * fmt, ...) va_start(args, fmt); overlayAlert_show(type, fmt, args); va_end(args); - - g_state.renderImGuiTwice = true; - app_invalidateWindow(false); } KeybindHandle app_registerKeybind(int sc, KeybindFn callback, void * opaque, const char * description) @@ -915,3 +912,10 @@ void app_overlayConfigRegisterTab(const char * title, { overlayConfig_registerTab(title, callback, udata); } + +void app_invalidateOverlay(bool renderTwice) +{ + if (renderTwice) + g_state.renderImGuiTwice = true; + app_invalidateWindow(false); +} diff --git a/client/src/overlay/alert.c b/client/src/overlay/alert.c index 8d327dc2..6a640a5e 100644 --- a/client/src/overlay/alert.c +++ b/client/src/overlay/alert.c @@ -130,5 +130,6 @@ void overlayAlert_show(LG_MsgAlert type, const char * fmt, va_list args) l_alert.timeout = ALERT_TIMEOUT; l_alert.type = type; l_alert.show = true; - l_alert.redraw = true; + + app_invalidateOverlay(true); }