mirror of
https://github.com/glfw/glfw.git
synced 2025-06-07 16:24:57 +00:00
Adjustments following PR request
This commit is contained in:
parent
697eefc6df
commit
9e2a82887e
@ -432,7 +432,6 @@ static GLFWbool createHelperWindow(void)
|
|||||||
return GLFW_TRUE;
|
return GLFW_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Creates the blank cursor
|
// Creates the blank cursor
|
||||||
//
|
//
|
||||||
static void createBlankCursor(void)
|
static void createBlankCursor(void)
|
||||||
@ -458,16 +457,16 @@ static void createBlankCursor(void)
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Initialize for remote sessions
|
// Initialize for remote sessions
|
||||||
|
//
|
||||||
static void initRemoteSession(void)
|
static void initRemoteSession(void)
|
||||||
{
|
{
|
||||||
//Check if the current progress was started with Remote Desktop.
|
//Check if the current progress was started with Remote Desktop.
|
||||||
_glfw.win32.isRemoteSession = GetSystemMetrics(SM_REMOTESESSION) > 0;
|
_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
|
// 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
|
// if cannot be moved to center in capture mode. If not Remote Desktop win32.blankCursor stays NULL
|
||||||
//and will perform has before (normal).
|
// and will perform has before (normal).
|
||||||
if (_glfw.win32.isRemoteSession)
|
if (_glfw.win32.isRemoteSession)
|
||||||
{
|
{
|
||||||
createBlankCursor();
|
createBlankCursor();
|
||||||
|
@ -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);
|
pos.y = (int)((data->data.mouse.lLastY / 65535.0f) * height);
|
||||||
ScreenToClient(window->win32.handle, &pos);
|
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;
|
dx = pos.x - window->win32.lastCursorPosX;
|
||||||
dy = pos.y - window->win32.lastCursorPosY;
|
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,
|
// NOTE: Re-center the cursor only if it has moved since the last call,
|
||||||
// to avoid breaking glfwWaitEvents with WM_MOUSEMOVE
|
// 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 ||
|
if (window->win32.lastCursorPosX != width / 2 ||
|
||||||
window->win32.lastCursorPosY != height / 2)
|
window->win32.lastCursorPosY != height / 2)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user