Skip to content

Commit 21f15ad

Browse files
committed
disable imgui.ini via prefs file settings
1 parent 892a332 commit 21f15ad

File tree

3 files changed

+21
-3
lines changed

3 files changed

+21
-3
lines changed

src/render/mock_opengl/mock_gl_engine.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1634,6 +1634,12 @@ void MockGLEngine::configureImGui() {
16341634
}
16351635

16361636
ImGuiIO& io = ImGui::GetIO();
1637+
1638+
// if polyscope's prefs file is disabled, disable imgui's ini file too
1639+
if (!options::usePrefsFile) {
1640+
io.IniFilename = nullptr;
1641+
}
1642+
16371643
io.Fonts->Clear();
16381644
io.Fonts->Build();
16391645
}

src/render/opengl/gl_engine_egl.cpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ void GLEngineEGL::initialize() {
257257
info(0, ss.str());
258258
}
259259

260-
if(options::uiScale < 0) { // only set from system if the value is -1, meaning not set yet
260+
if (options::uiScale < 0) { // only set from system if the value is -1, meaning not set yet
261261
options::uiScale = 1.;
262262
}
263263

@@ -437,7 +437,7 @@ void GLEngineEGL::initializeImGui() {
437437
// functions
438438

439439
ImGui::CreateContext();
440-
ImPlot::CreateContext();
440+
ImPlot::CreateContext();
441441
configureImGui();
442442
}
443443

@@ -450,6 +450,12 @@ void GLEngineEGL::configureImGui() {
450450
}
451451

452452
ImGuiIO& io = ImGui::GetIO();
453+
454+
// if polyscope's prefs file is disabled, disable imgui's ini file too
455+
if (!options::usePrefsFile) {
456+
io.IniFilename = nullptr;
457+
}
458+
453459
io.Fonts->Clear();
454460
io.Fonts->Build();
455461
}

src/render/opengl/gl_engine_glfw.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,9 +179,15 @@ void GLEngineGLFW::configureImGui() {
179179
exception("uiScale is < 0. Perhaps it wasn't initialized?");
180180
}
181181

182+
ImGuiIO& io = ImGui::GetIO();
183+
184+
// if polyscope's prefs file is disabled, disable imgui's ini file too
185+
if (!options::usePrefsFile) {
186+
io.IniFilename = nullptr;
187+
}
188+
182189
if (options::prepareImGuiFontsCallback) {
183190

184-
ImGuiIO& io = ImGui::GetIO();
185191
io.Fonts->Clear();
186192

187193
// these are necessary if different fonts are loaded in the callback

0 commit comments

Comments
 (0)