File tree 1 file changed +9
-10
lines changed 1 file changed +9
-10
lines changed Original file line number Diff line number Diff line change @@ -6161,19 +6161,18 @@ void ImGui::FocusWindow(ImGuiWindow* window)
6161
6161
// Close popups if any
6162
6162
ClosePopupsOverWindow(window, false);
6163
6163
6164
- // Passing NULL allow to disable keyboard focus
6165
- if (!window)
6166
- return;
6167
-
6168
6164
// Move the root window to the top of the pile
6169
- IM_ASSERT(window->RootWindow != NULL);
6170
- ImGuiWindow* focus_front_window = window->RootWindow; // NB: In docking branch this is window->RootWindowDockStop
6171
- ImGuiWindow* display_front_window = window->RootWindow;
6165
+ IM_ASSERT(window == NULL || window ->RootWindow != NULL);
6166
+ ImGuiWindow* focus_front_window = window ? window ->RootWindow : NULL ; // NB: In docking branch this is window->RootWindowDockStop
6167
+ ImGuiWindow* display_front_window = window ? window ->RootWindow : NULL ;
6172
6168
6173
6169
// Steal focus on active widgets
6174
- if (focus_front_window->Flags & ImGuiWindowFlags_Popup) // FIXME: This statement may be unnecessary? Need further testing before removing it..
6175
- if (g.ActiveId != 0 && g.ActiveIdWindow && g.ActiveIdWindow->RootWindow != focus_front_window)
6176
- ClearActiveID();
6170
+ if (g.ActiveId != 0 && g.ActiveIdWindow && g.ActiveIdWindow->RootWindow != focus_front_window)
6171
+ ClearActiveID();
6172
+
6173
+ // Passing NULL allow to disable keyboard focus
6174
+ if (!window)
6175
+ return;
6177
6176
6178
6177
// Bring to front
6179
6178
BringWindowToFocusFront(focus_front_window);
You can’t perform that action at this time.
0 commit comments