Skip to content

Commit

Permalink
fix: OSX Don't set cursor unconditionally.
Browse files Browse the repository at this point in the history
  • Loading branch information
stuartcarnie committed Dec 10, 2021
1 parent 3a3b9ae commit 957b5cb
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions backends/imgui_impl_osx.mm
Original file line number Diff line number Diff line change
Expand Up @@ -227,8 +227,12 @@ static void ImGui_ImplOSX_UpdateMouseCursorAndButtons()
}
else
{
// Show OS mouse cursor
[g_MouseCursors[g_MouseCursors[imgui_cursor] ? imgui_cursor : ImGuiMouseCursor_Arrow] set];
NSCursor *desired = g_MouseCursors[imgui_cursor] ?: g_MouseCursors[ImGuiMouseCursor_Arrow];
// -[NSCursor set] generates measureable overhead if called unconditionally.
if (desired != NSCursor.currentCursor)
{
[desired set];
}
if (g_MouseCursorHidden)
{
g_MouseCursorHidden = false;
Expand Down

0 comments on commit 957b5cb

Please sign in to comment.