Browse Source

When testing for the presence of the ImGuiWindowFlags_NoBringToFrontOnFocus flag we test both the focused/clicked window (which could be a child window) and the root window.

omar 5 năm trước cách đây
mục cha
commit
fc42528f13
2 tập tin đã thay đổi với 3 bổ sung1 xóa
  1. 2 0
      docs/CHANGELOG.txt
  2. 1 1
      imgui.cpp

+ 2 - 0
docs/CHANGELOG.txt

@@ -78,6 +78,8 @@ Other Changes:
 - ColorEdit: "Copy As" content-menu tool shows hex values both with/without alpha when available.
 - MenuBar: Fix minor clipping issue where occasionally a menu text can overlap the right-most border.
 - Window: Fix SetNextWindowBgAlpha(1.0f) failing to override alpha component. (#3007) [@Albog]
+- Window: When testing for the presence of the ImGuiWindowFlags_NoBringToFrontOnFocus flag we
+  test both the focused/clicked window (which could be a child window) and the root window.
 - ImDrawList: AddCircle(), AddCircleFilled() API can now auto-tessellate when provided a segment
   count of zero. Alter tessellation quality with 'style.CircleSegmentMaxError'. [@ShironekoBen]
 - ImDrawList: Add AddNgon(), AddNgonFilled() API with a guarantee on the explicit segment count.

+ 1 - 1
imgui.cpp

@@ -6050,7 +6050,7 @@ void ImGui::FocusWindow(ImGuiWindow* window)
 
     // Bring to front
     BringWindowToFocusFront(focus_front_window);
-    if ((display_front_window->Flags & ImGuiWindowFlags_NoBringToFrontOnFocus) == 0)
+    if (((window->Flags | display_front_window->Flags) & ImGuiWindowFlags_NoBringToFrontOnFocus) == 0)
         BringWindowToDisplayFront(display_front_window);
 }