From aed7a197c797fe24cfff32a19f8d981713a6bb2d Mon Sep 17 00:00:00 2001 From: Luflosi Date: Fri, 22 Nov 2019 02:12:42 +0100 Subject: [PATCH] =?UTF-8?q?Wayland:=20Don=E2=80=99t=20reload=20the=20curso?= =?UTF-8?q?r=20on=20every=20pointer=20motion?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From upstream: https://github.com/glfw/glfw/commit/a9f674e719cd663560418de2a7fa1147ce6c6c9b. --- glfw/wl_init.c | 4 +++- glfw/wl_platform.h | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/glfw/wl_init.c b/glfw/wl_init.c index e30344857..372a0f306 100644 --- a/glfw/wl_init.c +++ b/glfw/wl_init.c @@ -165,6 +165,7 @@ static void setCursor(GLFWCursorShape shape) wl_surface_damage(surface, 0, 0, image->width, image->height); wl_surface_commit(surface); + _glfw.wl.cursorPreviousShape = shape; } static void pointerHandleMotion(void* data UNUSED, @@ -219,7 +220,8 @@ static void pointerHandleMotion(void* data UNUSED, default: assert(0); } - setCursor(cursorShape); + if (_glfw.wl.cursorPreviousShape != cursorShape) + setCursor(cursorShape); } static void pointerHandleButton(void* data UNUSED, diff --git a/glfw/wl_platform.h b/glfw/wl_platform.h index ee15384d5..2718aae3a 100644 --- a/glfw/wl_platform.h +++ b/glfw/wl_platform.h @@ -248,6 +248,7 @@ typedef struct _GLFWlibraryWayland struct wl_cursor_theme* cursorTheme; struct wl_surface* cursorSurface; + GLFWCursorShape cursorPreviousShape; uint32_t pointerSerial; int32_t keyboardRepeatRate;