diff --git a/include/SpecialK/input/input.h b/include/SpecialK/input/input.h index fc2a4f6ba..2dccdd67f 100644 --- a/include/SpecialK/input/input.h +++ b/include/SpecialK/input/input.h @@ -1334,6 +1334,8 @@ bool SK_Window_IsCursorActive (void); bool SK_ImGui_CursorWarpingCooledDown (void); void SK_ImGui_UpdateLastCursorWarpTime (void); +extern bool SK_ImGui_IsHWCursorVisible; + enum SK_InputEnablement { Enabled = 0, Disabled = 1, diff --git a/include/imgui/imgui_user.inl b/include/imgui/imgui_user.inl index abdada263..38a6456d2 100644 --- a/include/imgui/imgui_user.inl +++ b/include/imgui/imgui_user.inl @@ -3243,7 +3243,8 @@ SK_ImGui_UpdateClassCursor (void) extern HWND SK_CachedForegroundWindow; extern DWORD SK_CachedForegroundWindowTime; -HANDLE hPollCursorEvent; +HANDLE hPollCursorEvent; +bool SK_ImGui_IsHWCursorVisible = false; DWORD WINAPI @@ -3260,6 +3261,8 @@ SK_ImGui_CursorPollingThread (LPVOID) SK_GetCursorPos (&SK_ImGui_LastKnownCursorPos); SK_ImGui_LastKnownCursor = SK_GetCursor (); + SK_ImGui_IsHWCursorVisible = + SK_InputUtil_IsHWCursorVisible (); } SK_Thread_CloseSelf (); @@ -3286,10 +3289,10 @@ SK_ImGui_User_NewFrame (void) SetEvent (hPollCursorEvent); - bool capture_mouse = SK_ImGui_WantMouseCapture (false, &cursor_pos); - bool anything_hovered = SK_ImGui_IsAnythingHovered (); - HWND hWndForeground = SK_GetForegroundWindow (); - BOOL bHWCursorVisible = SK_InputUtil_IsHWCursorVisible (); + bool capture_mouse = SK_ImGui_WantMouseCapture (false, &cursor_pos); + bool anything_hovered = SK_ImGui_IsAnythingHovered (); + HWND hWndForeground = SK_GetForegroundWindow (); + BOOL bHWCursorVisible = SK_ImGui_IsHWCursorVisible; SK_CachedForegroundWindow = hWndForeground; SK_CachedForegroundWindowTime = SK::ControlPanel::current_time; @@ -3707,7 +3710,7 @@ SK_ImGui_User_NewFrame (void) } io.MouseDrawCursor = - (! SK_InputUtil_IsHWCursorVisible ()); + (! SK_ImGui_IsHWCursorVisible); } else diff --git a/src/control_panel.cpp b/src/control_panel.cpp index e22a68f4c..75359f1ea 100644 --- a/src/control_panel.cpp +++ b/src/control_panel.cpp @@ -1791,7 +1791,7 @@ SK_Display_ResolutionSelectUI (bool bMarkDirty) ImGui::PopItemWidth (); } - static BOOL bDPIAware = + static bool bDPIAware = IsProcessDPIAware (), bImmutableDPI = FALSE; diff --git a/src/control_panel/cfg_input.cpp b/src/control_panel/cfg_input.cpp index d14798510..0e4f6f03d 100644 --- a/src/control_panel/cfg_input.cpp +++ b/src/control_panel/cfg_input.cpp @@ -3136,7 +3136,7 @@ SK_ImGui_CursorBoundaryConfig (bool window_mgmt = false) { if (SK_ImGui_Cursor.force == sk_cursor_state::None) { - if (! SK_InputUtil_IsHWCursorVisible ()) + if (! SK_ImGui_IsHWCursorVisible) { if (ImGui::Button (" Force Mouse Cursor Visible ")) { diff --git a/src/input/cursor.cpp b/src/input/cursor.cpp index 434698577..c2517c1eb 100644 --- a/src/input/cursor.cpp +++ b/src/input/cursor.cpp @@ -492,7 +492,7 @@ ImGuiCursor_Impl (void) if (SK_ImGui_WantHWCursor ()) { io.MouseDrawCursor = - ( (! SK_ImGui_Cursor.idle) && SK_ImGui_IsMouseRelevant () && (! SK_InputUtil_IsHWCursorVisible ())); + ( (! SK_ImGui_Cursor.idle) && SK_ImGui_IsMouseRelevant () && (! SK_ImGui_IsHWCursorVisible)); } // @@ -505,7 +505,7 @@ ImGuiCursor_Impl (void) SK_SendMsgSetCursor (0); } - io.MouseDrawCursor = (! SK_ImGui_Cursor.idle) && (! SK_InputUtil_IsHWCursorVisible ()); + io.MouseDrawCursor = (! SK_ImGui_Cursor.idle) && (! SK_ImGui_IsHWCursorVisible); } } @@ -609,7 +609,7 @@ SK_ImGui_WantMouseCaptureEx (DWORD dwReasonMask, POINT *pptCursor) if (game_window.mouse.can_track && (! game_window.mouse.inside) && config.input.mouse.disabled_to_game == SK_InputEnablement::DisabledInBackground) imgui_capture = true; - else if (config.input.ui.capture_hidden && (! SK_InputUtil_IsHWCursorVisible ())) + else if (config.input.ui.capture_hidden && (! SK_ImGui_IsHWCursorVisible)) imgui_capture = true; if (game_window.active && ReadULong64Acquire (&config.input.mouse.temporarily_allow) > SK_GetFramesDrawn () - 20) diff --git a/src/render/screenshot.cpp b/src/render/screenshot.cpp index 99d86f7ea..1e77a5b2c 100644 --- a/src/render/screenshot.cpp +++ b/src/render/screenshot.cpp @@ -2243,7 +2243,7 @@ SK_ScreenshotManager::setSnipState (SK_ScreenshotManager::SnippingState state) else if (state == SnippingRequested || state == SnippingActive) { - if (! SK_InputUtil_IsHWCursorVisible ()) + if (! SK_ImGui_IsHWCursorVisible) { do {