mirror of
https://github.com/ocornut/imgui.git
synced 2026-06-01 09:44:20 +08:00
Viewports: fixed an issue where window repositioning leading to a monitor change could have the window incorrectly get clamped within the boundaries of its previous monitor. (#8484)
This commit is contained in:
@@ -166,6 +166,9 @@ Docking+Viewports Branch:
|
|||||||
|
|
||||||
- Docking: Removed legacy assert preventing to call DockBuilderSplitNode() on an existing
|
- Docking: Removed legacy assert preventing to call DockBuilderSplitNode() on an existing
|
||||||
split node. This makes using DockBuilder a little more flexible and bearable! (#8472) [@MegaMech]
|
split node. This makes using DockBuilder a little more flexible and bearable! (#8472) [@MegaMech]
|
||||||
|
- Viewports: fixed an issue where in certain cases, a window repositioning leading
|
||||||
|
to a monitor change could have the window incorrectly get clamped within the boundaries
|
||||||
|
of its previous monitor. Would happen e.g. when loading .ini data during runtime. (#8484)
|
||||||
- Viewports: fixed an assert when a window load settings with a position outside
|
- Viewports: fixed an assert when a window load settings with a position outside
|
||||||
monitor bounds, when there are multiple monitors. (#8393, #8385) [@gaborodriguez]
|
monitor bounds, when there are multiple monitors. (#8393, #8385) [@gaborodriguez]
|
||||||
- Viewports + Backends: Win32: Fixed setting title bar text when application
|
- Viewports + Backends: Win32: Fixed setting title bar text when application
|
||||||
|
|||||||
@@ -16144,11 +16144,15 @@ ImGuiViewportP* ImGui::AddUpdateViewport(ImGuiWindow* window, ImGuiID id, const
|
|||||||
if (viewport)
|
if (viewport)
|
||||||
{
|
{
|
||||||
// Always update for main viewport as we are already pulling correct platform pos/size (see #4900)
|
// Always update for main viewport as we are already pulling correct platform pos/size (see #4900)
|
||||||
|
ImVec2 prev_pos = viewport->Pos;
|
||||||
|
ImVec2 prev_size = viewport->Size;
|
||||||
if (!viewport->PlatformRequestMove || viewport->ID == IMGUI_VIEWPORT_DEFAULT_ID)
|
if (!viewport->PlatformRequestMove || viewport->ID == IMGUI_VIEWPORT_DEFAULT_ID)
|
||||||
viewport->Pos = pos;
|
viewport->Pos = pos;
|
||||||
if (!viewport->PlatformRequestResize || viewport->ID == IMGUI_VIEWPORT_DEFAULT_ID)
|
if (!viewport->PlatformRequestResize || viewport->ID == IMGUI_VIEWPORT_DEFAULT_ID)
|
||||||
viewport->Size = size;
|
viewport->Size = size;
|
||||||
viewport->Flags = flags | (viewport->Flags & (ImGuiViewportFlags_IsMinimized | ImGuiViewportFlags_IsFocused)); // Preserve existing flags
|
viewport->Flags = flags | (viewport->Flags & (ImGuiViewportFlags_IsMinimized | ImGuiViewportFlags_IsFocused)); // Preserve existing flags
|
||||||
|
if (prev_pos != viewport->Pos || prev_size != viewport->Size)
|
||||||
|
UpdateViewportPlatformMonitor(viewport);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user