IO: do not disable io.ConfigWindowsResizeFromEdges when ImGuiBackendFlags_HasMouseCursors is not set by backend.

Amend 42bf149ac
This commit is contained in:
ocornut 2024-06-11 14:15:13 +02:00
parent 8caf7afbad
commit b902fa4c44
2 changed files with 6 additions and 4 deletions

View File

@ -46,6 +46,12 @@ Breaking changes:
Other changes:
- IO: do not disable io.ConfigWindowsResizeFromEdges (which allow resizing from borders
and lower-left corner) when ImGuiBackendFlags_HasMouseCursors is not set by backend.
The initial reasoning is that resizing from borders feels better when correct mouse cursor
shape change as honored by backends. Keeping this enabling will hopefully increase pressure
on third-party backends to set ImGuiBackendFlags_HasMouseCursors and honor changes of
ImGui::GetMouseCursor() value. (#1495)
- Examples: GLFW+Vulkan, SDL+Vulkan: handle swap chain resize even without Vulkan
returning VK_SUBOPTIMAL_KHR, which doesn't seem to happen on Wayland. (#7671)
[@AndreiNego, @ocornut]

View File

@ -9919,10 +9919,6 @@ static void ImGui::ErrorCheckNewFrameSanityChecks()
if ((g.IO.ConfigFlags & ImGuiConfigFlags_NavEnableKeyboard) && g.IO.BackendUsingLegacyKeyArrays == 1)
IM_ASSERT(g.IO.KeyMap[ImGuiKey_Space] != -1 && "ImGuiKey_Space is not mapped, required for keyboard navigation.");
#endif
// Check: the io.ConfigWindowsResizeFromEdges option requires backend to honor mouse cursor changes and set the ImGuiBackendFlags_HasMouseCursors flag accordingly.
if (g.IO.ConfigWindowsResizeFromEdges && !(g.IO.BackendFlags & ImGuiBackendFlags_HasMouseCursors))
g.IO.ConfigWindowsResizeFromEdges = false;
}
static void ImGui::ErrorCheckEndFrameSanityChecks()