mirror of
https://github.com/ocornut/imgui.git
synced 2026-06-04 22:28:15 +08:00
Backends: GLFW: mouse cursor is properly restored if changed by user app/code while using glfwSetInputMode(..., GLFW_CURSOR_DISABLED) or ImGuiConfigFlags_NoMouseCursorChange. (#9322)
Amend 9a4fd69f6
This commit is contained in:
@@ -29,6 +29,7 @@
|
|||||||
|
|
||||||
// CHANGELOG
|
// CHANGELOG
|
||||||
// (minor and older changes stripped away, please see git history for details)
|
// (minor and older changes stripped away, please see git history for details)
|
||||||
|
// 2026-03-25: Mouse cursor is properly restored if changed by user app/code while using glfwSetInputMode(..., GLFW_CURSOR_DISABLED) or ImGuiConfigFlags_NoMouseCursorChange. Amend change from 2025-12-10.
|
||||||
// 2026-02-10: Try to set IMGUI_IMPL_GLFW_DISABLE_X11 / IMGUI_IMPL_GLFW_DISABLE_WAYLAND automatically if corresponding headers are not accessible. (#9225)
|
// 2026-02-10: Try to set IMGUI_IMPL_GLFW_DISABLE_X11 / IMGUI_IMPL_GLFW_DISABLE_WAYLAND automatically if corresponding headers are not accessible. (#9225)
|
||||||
// 2025-12-12: Added IMGUI_IMPL_GLFW_DISABLE_X11 / IMGUI_IMPL_GLFW_DISABLE_WAYLAND to forcefully disable either.
|
// 2025-12-12: Added IMGUI_IMPL_GLFW_DISABLE_X11 / IMGUI_IMPL_GLFW_DISABLE_WAYLAND to forcefully disable either.
|
||||||
// 2025-12-10: Avoid repeated glfwSetCursor()/glfwSetInputMode() calls when unnecessary. Lowers overhead for very high framerates (e.g. 10k+ FPS).
|
// 2025-12-10: Avoid repeated glfwSetCursor()/glfwSetInputMode() calls when unnecessary. Lowers overhead for very high framerates (e.g. 10k+ FPS).
|
||||||
@@ -859,7 +860,10 @@ static void ImGui_ImplGlfw_UpdateMouseCursor()
|
|||||||
ImGuiIO& io = ImGui::GetIO();
|
ImGuiIO& io = ImGui::GetIO();
|
||||||
ImGui_ImplGlfw_Data* bd = ImGui_ImplGlfw_GetBackendData();
|
ImGui_ImplGlfw_Data* bd = ImGui_ImplGlfw_GetBackendData();
|
||||||
if ((io.ConfigFlags & ImGuiConfigFlags_NoMouseCursorChange) || glfwGetInputMode(bd->Window, GLFW_CURSOR) == GLFW_CURSOR_DISABLED)
|
if ((io.ConfigFlags & ImGuiConfigFlags_NoMouseCursorChange) || glfwGetInputMode(bd->Window, GLFW_CURSOR) == GLFW_CURSOR_DISABLED)
|
||||||
|
{
|
||||||
|
bd->LastMouseCursor = nullptr; // Invalidate so that if user changes underlying cursor we will update it next time we can.
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
ImGuiMouseCursor imgui_cursor = ImGui::GetMouseCursor();
|
ImGuiMouseCursor imgui_cursor = ImGui::GetMouseCursor();
|
||||||
// (those braces are here to reduce diff with multi-viewports support in 'docking' branch)
|
// (those braces are here to reduce diff with multi-viewports support in 'docking' branch)
|
||||||
|
|||||||
@@ -145,6 +145,9 @@ Other Changes:
|
|||||||
- Backends:
|
- Backends:
|
||||||
- DirectX9, OpenGL2, OpenGL3, Metal, SDLGPU3, SDLRenderer2, SDLRenderer3: fixed easy-to-fix
|
- DirectX9, OpenGL2, OpenGL3, Metal, SDLGPU3, SDLRenderer2, SDLRenderer3: fixed easy-to-fix
|
||||||
issues in code assuming ImTextureID_Invalid is always defined to 0. (#9295, #9310)
|
issues in code assuming ImTextureID_Invalid is always defined to 0. (#9295, #9310)
|
||||||
|
- GLFW: mouse cursor is properly restored if changed by user app/code while using
|
||||||
|
glfwSetInputMode(..., GLFW_CURSOR_DISABLED) or ImGuiConfigFlags_NoMouseCursorChange.
|
||||||
|
Amend optimization done in 1.92.6.
|
||||||
- SDLGPU3: removed unnecessary call to SDL_WaitForGPUIdle when releasing
|
- SDLGPU3: removed unnecessary call to SDL_WaitForGPUIdle when releasing
|
||||||
vertex/index buffers. (#9262) [@jaenis]
|
vertex/index buffers. (#9262) [@jaenis]
|
||||||
- WebGPU: fixed version check for Emscripten 5.0.0+.
|
- WebGPU: fixed version check for Emscripten 5.0.0+.
|
||||||
|
|||||||
Reference in New Issue
Block a user