From 7c3c68b84b2852bd23a84fdd69851c36fe39871c Mon Sep 17 00:00:00 2001 From: Quantum Date: Sat, 31 Jul 2021 07:14:23 -0400 Subject: [PATCH] [client] imgui: put imgui.ini in $XDG_CONFIG_DIR/looking-glass --- client/src/main.c | 4 ++++ client/src/main.h | 1 + 2 files changed, 5 insertions(+) diff --git a/client/src/main.c b/client/src/main.c index 4af4b85c..dc7653f1 100644 --- a/client/src/main.c +++ b/client/src/main.c @@ -795,6 +795,8 @@ static int lg_run(void) g_state.io = igGetIO(); g_state.style = igGetStyle(); + alloc_sprintf(&g_state.imGuiIni, "%s/imgui.ini", lgConfigDir()); + g_state.io->IniFilename = g_state.imGuiIni; g_state.io->BackendFlags |= ImGuiBackendFlags_HasMouseCursors; g_state.windowScale = 1.0; @@ -1156,6 +1158,8 @@ static void lg_shutdown(void) g_state.overlays = NULL; } + free(g_state.imGuiIni); + if (g_state.frameEvent) { lgFreeEvent(g_state.frameEvent); diff --git a/client/src/main.h b/client/src/main.h index 40c4f25b..8d5a4966 100644 --- a/client/src/main.h +++ b/client/src/main.h @@ -57,6 +57,7 @@ struct AppState ImGuiMouseCursor cursorLast; LGEvent * overlayRenderEvent; bool overlayMustWait; + char * imGuiIni; bool alertShow; char * alertMessage;