From b902fa4c4490ddffb713f8153d1a65e1940e58d1 Mon Sep 17 00:00:00 2001 From: ocornut Date: Tue, 11 Jun 2024 14:15:13 +0200 Subject: [PATCH] IO: do not disable io.ConfigWindowsResizeFromEdges when ImGuiBackendFlags_HasMouseCursors is not set by backend. Amend 42bf149ac --- docs/CHANGELOG.txt | 6 ++++++ imgui.cpp | 4 ---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/docs/CHANGELOG.txt b/docs/CHANGELOG.txt index b5caca628..4c680cf74 100644 --- a/docs/CHANGELOG.txt +++ b/docs/CHANGELOG.txt @@ -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] diff --git a/imgui.cpp b/imgui.cpp index f4545ec55..6f4398298 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -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()