mirror of
https://github.com/Drezil/imgui.git
synced 2024-11-15 09:27:00 +00:00
Viewport, Platform: Fixed a crash if the back-end set the PlatformRequestMove/PlatformRequestSize flags while viewports were disabled (it happened in the SDL back-end, and generally we want to tolerate it to make back-end implementation simpler). (#1542)
This commit is contained in:
parent
1176460e44
commit
ed84b2aaeb
@ -3555,6 +3555,8 @@ static void ImGui::UpdateViewports()
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ((g.IO.ConfigFlags & ImGuiConfigFlags_ViewportsEnable))
|
||||||
|
{
|
||||||
// Apply Position and Size (from Platform Window to ImGui) if requested.
|
// Apply Position and Size (from Platform Window to ImGui) if requested.
|
||||||
// We do it early in the frame instead of waiting for UpdatePlatformWindows() to avoid a frame of lag when moving/resizing using OS facilities.
|
// We do it early in the frame instead of waiting for UpdatePlatformWindows() to avoid a frame of lag when moving/resizing using OS facilities.
|
||||||
if (viewport->PlatformRequestMove)
|
if (viewport->PlatformRequestMove)
|
||||||
@ -3571,6 +3573,7 @@ static void ImGui::UpdateViewports()
|
|||||||
|
|
||||||
// Update monitor (we'll use this info to clamp windows and save windows lost in a removed monitor)
|
// Update monitor (we'll use this info to clamp windows and save windows lost in a removed monitor)
|
||||||
viewport->PlatformMonitor = FindPlatformMonitorForRect(viewport->GetRect());
|
viewport->PlatformMonitor = FindPlatformMonitorForRect(viewport->GetRect());
|
||||||
|
}
|
||||||
|
|
||||||
// Update DPI scale
|
// Update DPI scale
|
||||||
float new_dpi_scale;
|
float new_dpi_scale;
|
||||||
|
Loading…
Reference in New Issue
Block a user