From 86672a37246100f40077e692bc7130a8e4e87d2c Mon Sep 17 00:00:00 2001 From: Benjamin Porter Date: Sun, 17 Mar 2019 15:51:06 +1100 Subject: [PATCH] Fix: Win32 no longer hides cursor when hovering title bar, keeping in line with behaviour of other platforms. --- src/SFML/Window/Win32/WindowImplWin32.cpp | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/src/SFML/Window/Win32/WindowImplWin32.cpp b/src/SFML/Window/Win32/WindowImplWin32.cpp index e4e0dba5..925c2bf4 100755 --- a/src/SFML/Window/Win32/WindowImplWin32.cpp +++ b/src/SFML/Window/Win32/WindowImplWin32.cpp @@ -399,14 +399,8 @@ void WindowImplWin32::setVisible(bool visible) //////////////////////////////////////////////////////////// void WindowImplWin32::setMouseCursorVisible(bool visible) { - // Don't call twice ShowCursor with the same parameter value; - // we don't want to increment/decrement the internal counter - // more than once. - if (visible != m_cursorVisible) - { - m_cursorVisible = visible; - ShowCursor(visible); - } + m_cursorVisible = visible; + SetCursor(m_cursorVisible ? m_lastCursor : NULL); } @@ -422,7 +416,7 @@ void WindowImplWin32::setMouseCursorGrabbed(bool grabbed) void WindowImplWin32::setMouseCursor(const CursorImpl& cursor) { m_lastCursor = cursor.m_cursor; - SetCursor(m_lastCursor); + SetCursor(m_cursorVisible ? m_lastCursor : NULL); } @@ -586,8 +580,9 @@ void WindowImplWin32::processEvent(UINT message, WPARAM wParam, LPARAM lParam) case WM_SETCURSOR: { // The mouse has moved, if the cursor is in our window we must refresh the cursor - if (LOWORD(lParam) == HTCLIENT) - SetCursor(m_lastCursor); + if (LOWORD(lParam) == HTCLIENT) { + SetCursor(m_cursorVisible ? m_lastCursor : NULL); + } break; }