From 785937ecfcf3e36ec08641d9a9ed1965e897c0a1 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 9 Apr 2018 19:40:14 +0530 Subject: [PATCH] Remove unnecessary function calls glfwSetInputMode is a no-op if the passed in mode is the same as the current mode anyway. --- kitty/glfw.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/kitty/glfw.c b/kitty/glfw.c index 3b54ddad9..63b4f1005 100644 --- a/kitty/glfw.c +++ b/kitty/glfw.c @@ -74,7 +74,7 @@ is_window_ready_for_callbacks() { static inline void show_mouse_cursor(GLFWwindow *w) { - if (glfwGetInputMode(w, GLFW_CURSOR) != GLFW_CURSOR_NORMAL) { glfwSetInputMode(w, GLFW_CURSOR, GLFW_CURSOR_NORMAL); } + glfwSetInputMode(w, GLFW_CURSOR, GLFW_CURSOR_NORMAL); } static void @@ -620,9 +620,7 @@ set_os_window_title(OSWindow *w, const char *title) { void hide_mouse(OSWindow *w) { - if (glfwGetInputMode(w->handle, GLFW_CURSOR) != GLFW_CURSOR_HIDDEN) { - glfwSetInputMode(w->handle, GLFW_CURSOR, GLFW_CURSOR_HIDDEN); - } + glfwSetInputMode(w->handle, GLFW_CURSOR, GLFW_CURSOR_HIDDEN); } void