fix: Flickering cursor issues
This commit is contained in:
parent
c9c6f3aadb
commit
33d3bea472
29
lib/external/imgui/source/imgui_impl_glfw.cpp
vendored
29
lib/external/imgui/source/imgui_impl_glfw.cpp
vendored
@ -824,34 +824,7 @@ static void ImGui_ImplGlfw_UpdateMouseCursor()
|
||||
// FIXME-PLATFORM: Unfocused windows seems to fail changing the mouse cursor with GLFW 3.2, but 3.3 works here.
|
||||
|
||||
// IMHEX PATCH BEGIN
|
||||
#if defined(_WIN32)
|
||||
switch (imgui_cursor) {
|
||||
case ImGuiMouseCursor_Hand:
|
||||
SetCursor(LoadCursor(nullptr, IDC_HAND));
|
||||
break;
|
||||
case ImGuiMouseCursor_ResizeEW:
|
||||
SetCursor(LoadCursor(nullptr, IDC_SIZEWE));
|
||||
break;
|
||||
case ImGuiMouseCursor_ResizeNS:
|
||||
SetCursor(LoadCursor(nullptr, IDC_SIZENS));
|
||||
break;
|
||||
case ImGuiMouseCursor_ResizeNWSE:
|
||||
SetCursor(LoadCursor(nullptr, IDC_SIZENWSE));
|
||||
break;
|
||||
case ImGuiMouseCursor_ResizeNESW:
|
||||
SetCursor(LoadCursor(nullptr, IDC_SIZENESW));
|
||||
break;
|
||||
case ImGuiMouseCursor_ResizeAll:
|
||||
SetCursor(LoadCursor(nullptr, IDC_SIZEALL));
|
||||
break;
|
||||
case ImGuiMouseCursor_NotAllowed:
|
||||
SetCursor(LoadCursor(nullptr, IDC_NO));
|
||||
break;
|
||||
case ImGuiMouseCursor_TextInput:
|
||||
SetCursor(LoadCursor(nullptr, IDC_IBEAM));
|
||||
break;
|
||||
}
|
||||
#else
|
||||
#if !defined(_WIN32)
|
||||
glfwSetCursor(window, bd->MouseCursors[imgui_cursor] ? bd->MouseCursors[imgui_cursor] : bd->MouseCursors[ImGuiMouseCursor_Arrow]);
|
||||
#endif
|
||||
|
||||
|
@ -69,6 +69,43 @@ namespace hex {
|
||||
|
||||
break;
|
||||
}
|
||||
case WM_SETCURSOR: {
|
||||
if (LOWORD(lParam) != HTCLIENT) {
|
||||
return CallWindowProc((WNDPROC)g_oldWndProc, hwnd, uMsg, wParam, lParam);
|
||||
} else {
|
||||
switch (ImGui::GetMouseCursor()) {
|
||||
case ImGuiMouseCursor_Arrow:
|
||||
SetCursor(LoadCursor(nullptr, IDC_ARROW));
|
||||
break;
|
||||
case ImGuiMouseCursor_Hand:
|
||||
SetCursor(LoadCursor(nullptr, IDC_HAND));
|
||||
break;
|
||||
case ImGuiMouseCursor_ResizeEW:
|
||||
SetCursor(LoadCursor(nullptr, IDC_SIZEWE));
|
||||
break;
|
||||
case ImGuiMouseCursor_ResizeNS:
|
||||
SetCursor(LoadCursor(nullptr, IDC_SIZENS));
|
||||
break;
|
||||
case ImGuiMouseCursor_ResizeNWSE:
|
||||
SetCursor(LoadCursor(nullptr, IDC_SIZENWSE));
|
||||
break;
|
||||
case ImGuiMouseCursor_ResizeNESW:
|
||||
SetCursor(LoadCursor(nullptr, IDC_SIZENESW));
|
||||
break;
|
||||
case ImGuiMouseCursor_ResizeAll:
|
||||
SetCursor(LoadCursor(nullptr, IDC_SIZEALL));
|
||||
break;
|
||||
case ImGuiMouseCursor_NotAllowed:
|
||||
SetCursor(LoadCursor(nullptr, IDC_NO));
|
||||
break;
|
||||
case ImGuiMouseCursor_TextInput:
|
||||
SetCursor(LoadCursor(nullptr, IDC_IBEAM));
|
||||
break;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user