Skip to content

Commit 200754b

Browse files
committed
Examples: GLFW: Don't alter cursor mode if GLFW_CURSOR input mode is GLFW_CURSOR_DISABLED. (#1202) [@PhilCK]
1 parent 42ad3c1 commit 200754b

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

CHANGELOG.txt

+1
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,7 @@ Other Changes:
204204
- Examples: Win32 (DirectX9,10,11,12: Support for windows using the CS_DBLCLKS class flag by handling the double-click messages (WM_LBUTTONDBLCLK etc.). (#1538, #754) [@ndandoulakis]
205205
- Examples: Win32 (DirectX9,10,11,12): Made the Win32 proc handlers not assert if there is no active context yet, to be more flexible with creation order. (#1565)
206206
- Examples: GLFW: Added support for mouse cursor shapes (the diagonal resize cursors are unfortunately not supported by GLFW at the moment. (#1495)
207+
- Examples: GLFW: Don't attempt to change the mouse cursor input mode if it is set to GLFW_CURSOR_DISABLED by the application. (#1202) [@PhilCK]
207208
- Examples: SDL: Added support for mouse cursor shapes. (#1626) [@olls]
208209
- Examples: SDL: Using SDL_CaptureMouse() to retrieve coordinates outside of client area when dragging (SDL 2.0.4+ only, otherwise using SDL_WINDOW_INPUT_FOCUS instead of previously SDL_WINDOW_MOUSE_FOCUS). (#1559)
209210
- Examples: SDL: Enabled vsync by default so people don't come at us with demoes running at 2000 FPS burning a cpu core.

examples/imgui_impl_glfw.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ static void ImGui_ImplGlfw_UpdateMouse()
242242
}
243243

244244
// Update OS/hardware mouse cursor if imgui isn't drawing a software cursor
245-
if ((io.ConfigFlags & ImGuiConfigFlags_NoSetMouseCursor) == 0)
245+
if ((io.ConfigFlags & ImGuiConfigFlags_NoSetMouseCursor) == 0 && glfwGetInputMode(g_Window, GLFW_CURSOR) != GLFW_CURSOR_DISABLED)
246246
{
247247
ImGuiMouseCursor cursor = ImGui::GetMouseCursor();
248248
if (io.MouseDrawCursor || cursor == ImGuiMouseCursor_None)

0 commit comments

Comments
 (0)