ImGui: Keep the context and debugger state when Android switches away

NativeShutdownGraphics, which Android runs whenever the app loses its
surface, destroyed the imgui context and the ImDebugger along with the
device objects, so window layout and debugger state reset on return.
Now only the device objects go there (the backend already recreates
them), and the context and debugger are torn down in NativeShutdown.
Both configs are still saved on device loss, in case the app is killed
in the background.

imgui.ini is now read and written through our File API rather than
imgui's fopen, which can't reach a memstick behind a content URI.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Henrik RydgårdandClaude Opus 5.5 committed 2026-10-24 14:14:42 +02:00
1 parent c37498808c
commit 70988aa50c
5 files changed
+49 -14

No files matched your search

+4
View File
@@ -2656,6 +2656,10 @@ ImDebugger::ImDebugger() {
}
ImDebugger::~ImDebugger() {
SaveConfig();
}
void ImDebugger::SaveConfig() {
cfg_.SaveConfig(ConfigPath());
}