From 468468ab9fdd36d2cde60b4d01c154a047b8b31e Mon Sep 17 00:00:00 2001 From: Luflosi Date: Fri, 22 Nov 2019 12:38:56 +0100 Subject: [PATCH] =?UTF-8?q?Wayland:=20Don=E2=80=99t=20update=20cursor=20po?= =?UTF-8?q?sition=20in=20the=20frame?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From upstream: https://github.com/glfw/glfw/commit/a80788c17f3376177b45d52f983d4d98f1175af2. --- glfw/wl_init.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/glfw/wl_init.c b/glfw/wl_init.c index 372a0f306..8c67f7a3a 100644 --- a/glfw/wl_init.c +++ b/glfw/wl_init.c @@ -176,43 +176,45 @@ static void pointerHandleMotion(void* data UNUSED, { _GLFWwindow* window = _glfw.wl.pointerFocus; GLFWCursorShape cursorShape = GLFW_ARROW_CURSOR; + double x, y; if (!window) return; if (window->cursorMode == GLFW_CURSOR_DISABLED) return; - window->wl.cursorPosX = wl_fixed_to_double(sx); - window->wl.cursorPosY = wl_fixed_to_double(sy); + x = wl_fixed_to_double(sx); + y = wl_fixed_to_double(sy); switch (window->wl.decorations.focus) { case mainWindow: - _glfwInputCursorPos(window, - window->wl.cursorPosX, window->wl.cursorPosY); + window->wl.cursorPosX = x; + window->wl.cursorPosY = y; + _glfwInputCursorPos(window, x, y); return; case topDecoration: - if (window->wl.cursorPosY < _GLFW_DECORATION_WIDTH) + if (y < _GLFW_DECORATION_WIDTH) cursorShape = GLFW_VRESIZE_CURSOR; else cursorShape = GLFW_ARROW_CURSOR; break; case leftDecoration: - if (window->wl.cursorPosY < _GLFW_DECORATION_WIDTH) + if (y < _GLFW_DECORATION_WIDTH) cursorShape = GLFW_NW_RESIZE_CURSOR; else cursorShape = GLFW_HRESIZE_CURSOR; break; case rightDecoration: - if (window->wl.cursorPosY < _GLFW_DECORATION_WIDTH) + if (y < _GLFW_DECORATION_WIDTH) cursorShape = GLFW_NE_RESIZE_CURSOR; else cursorShape = GLFW_HRESIZE_CURSOR; break; case bottomDecoration: - if (window->wl.cursorPosX < _GLFW_DECORATION_WIDTH) + if (x < _GLFW_DECORATION_WIDTH) cursorShape = GLFW_SW_RESIZE_CURSOR; - else if (window->wl.cursorPosX > window->wl.width + _GLFW_DECORATION_WIDTH) + else if (x > window->wl.width + _GLFW_DECORATION_WIDTH) cursorShape = GLFW_SE_RESIZE_CURSOR; else cursorShape = GLFW_VRESIZE_CURSOR;