From 9e2a82887e71242ece782ae34c97dfa7fcb5776d Mon Sep 17 00:00:00 2001 From: Hilderin <81109165+Hilderin@users.noreply.github.com> Date: Fri, 26 Jan 2024 08:03:14 -0500 Subject: [PATCH] Adjustments following PR request --- src/win32_init.c | 9 ++++----- src/win32_window.c | 10 +--------- 2 files changed, 5 insertions(+), 14 deletions(-) diff --git a/src/win32_init.c b/src/win32_init.c index 59034778..8887eb75 100644 --- a/src/win32_init.c +++ b/src/win32_init.c @@ -432,7 +432,6 @@ static GLFWbool createHelperWindow(void) return GLFW_TRUE; } - // Creates the blank cursor // static void createBlankCursor(void) @@ -458,16 +457,16 @@ static void createBlankCursor(void) } - // Initialize for remote sessions +// static void initRemoteSession(void) { //Check if the current progress was started with Remote Desktop. _glfw.win32.isRemoteSession = GetSystemMetrics(SM_REMOTESESSION) > 0; - //With Remote desktop, we need to create a blank cursor because of the cursor is Set to NULL - //if cannot be moved to center in capture mode. If not Remote Desktop win32.blankCursor stays NULL - //and will perform has before (normal). + // With Remote desktop, we need to create a blank cursor because of the cursor is Set to NULL + // if cannot be moved to center in capture mode. If not Remote Desktop win32.blankCursor stays NULL + // and will perform has before (normal). if (_glfw.win32.isRemoteSession) { createBlankCursor(); diff --git a/src/win32_window.c b/src/win32_window.c index 4ca299e2..d6ebb3b8 100644 --- a/src/win32_window.c +++ b/src/win32_window.c @@ -945,14 +945,6 @@ static LRESULT CALLBACK windowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM l pos.y = (int)((data->data.mouse.lLastY / 65535.0f) * height); ScreenToClient(window->win32.handle, &pos); - - _glfwGetWindowSizeWin32(window, &window_width, &window_height); - - // One other unfortunate thing is that re-centering the cursor will still fire an - // input event; assume that any motion to the center is our re-centering and ignore it - if (pos.x == window_width / 2 && pos.y == window_height / 2) - break; - dx = pos.x - window->win32.lastCursorPosX; dy = pos.y - window->win32.lastCursorPosY; } @@ -2142,7 +2134,7 @@ void _glfwPollEventsWin32(void) // NOTE: Re-center the cursor only if it has moved since the last call, // to avoid breaking glfwWaitEvents with WM_MOUSEMOVE - // The recenter is important to prevent the mouse cursor to stop at the edges of the screen. + // The re-center is required in order to prevent the mouse cursor stopping at the edges of the screen. if (window->win32.lastCursorPosX != width / 2 || window->win32.lastCursorPosY != height / 2) {