Skip to content

Commit 47efb10

Browse files
committed
fix (mvToolWindow): Bring debug windows to front in show_tool
1 parent 572541e commit 47efb10

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

src/mvToolManager.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ void mvToolManager::ShowTool(mvUUID name)
5757
{
5858
if (tool->getUUID() == name)
5959
{
60-
tool->m_show = true;
60+
tool->m_focusNextFrame = tool->m_show = true;
6161
return;
6262
}
6363
}

src/mvToolWindow.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,12 @@ void mvToolWindow::draw()
1818
m_dirtyPos = false;
1919
}
2020

21+
if (m_focusNextFrame)
22+
{
23+
ImGui::SetNextWindowFocus();
24+
m_focusNextFrame = false;
25+
}
26+
2127
if (!ImGui::Begin(getTitle(), &m_show, m_windowflags))
2228
{
2329
ImGui::End();

src/mvToolWindow.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ class mvToolWindow
2929

3030
ImGuiWindowFlags m_windowflags = ImGuiWindowFlags_NoSavedSettings;
3131
bool m_show = false;
32+
bool m_focusNextFrame = false;
3233
bool m_dirtySize = true;
3334
bool m_dirtyPos = true;
3435
int m_xpos = 200;

0 commit comments

Comments
 (0)