File tree 2 files changed +8
-2
lines changed
2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -83,6 +83,11 @@ Other changes:
83
83
- Backends: WebGPU: Fix for DAWN API rename WGPUProgrammableStageDescriptor -> WGPUComputeState.
84
84
[@PhantomCloak] (#8369)
85
85
86
+ Docking+Viewports Branch:
87
+
88
+ - Viewports: fixed an assert when a window load settings with a position outside
89
+ monitor bounds, when there are multiple monitors. (#8393, #8385) [@gaborodriguez]
90
+
86
91
87
92
-----------------------------------------------------------------------
88
93
VERSION 1.91.8 (Released 2025-01-31)
Original file line number Diff line number Diff line change @@ -16536,13 +16536,14 @@ static int ImGui::FindPlatformMonitorForRect(const ImRect& rect)
16536
16536
ImGuiContext& g = *GImGui;
16537
16537
16538
16538
const int monitor_count = g.PlatformIO.Monitors.Size;
16539
+ IM_ASSERT(monitor_count > 0);
16539
16540
if (monitor_count <= 1)
16540
- return monitor_count - 1 ;
16541
+ return 0 ;
16541
16542
16542
16543
// Use a minimum threshold of 1.0f so a zero-sized rect won't false positive, and will still find the correct monitor given its position.
16543
16544
// This is necessary for tooltips which always resize down to zero at first.
16544
16545
const float surface_threshold = ImMax(rect.GetWidth() * rect.GetHeight() * 0.5f, 1.0f);
16545
- int best_monitor_n = -1;
16546
+ int best_monitor_n = 0; // Default to the first monitor as fallback
16546
16547
float best_monitor_surface = 0.001f;
16547
16548
16548
16549
for (int monitor_n = 0; monitor_n < g.PlatformIO.Monitors.Size && best_monitor_surface < surface_threshold; monitor_n++)
You can’t perform that action at this time.
0 commit comments