From 6ac0835ad2a98925bda1c855937340dc160f1db2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Camilla=20L=C3=B6wy?= Date: Thu, 8 Feb 2024 00:05:29 +0100 Subject: [PATCH] Wayland: Cleanup --- src/wl_window.c | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/src/wl_window.c b/src/wl_window.c index a2e13c22..712c58b4 100644 --- a/src/wl_window.c +++ b/src/wl_window.c @@ -1431,9 +1431,6 @@ static void pointerHandleButton(void* userData, uint32_t state) { _GLFWwindow* window = _glfw.wl.pointerFocus; - int glfwButton; - uint32_t edges = XDG_TOPLEVEL_RESIZE_EDGE_NONE; - if (!window) return; @@ -1441,21 +1438,17 @@ static void pointerHandleButton(void* userData, { _glfw.wl.serial = serial; - /* Makes left, right and middle 0, 1 and 2. Overall order follows evdev - * codes. */ - glfwButton = button - BTN_LEFT; - _glfwInputMouseClick(window, - glfwButton, - state == WL_POINTER_BUTTON_STATE_PRESSED - ? GLFW_PRESS - : GLFW_RELEASE, - _glfw.wl.xkb.modifiers); + button - BTN_LEFT, + state == WL_POINTER_BUTTON_STATE_PRESSED, + _glfw.wl.xkb.modifiers); return; } if (button == BTN_LEFT) { + uint32_t edges = XDG_TOPLEVEL_RESIZE_EDGE_NONE; + switch (window->wl.fallback.focus) { case GLFW_TOP_DECORATION: @@ -1484,8 +1477,6 @@ static void pointerHandleButton(void* userData, else edges = XDG_TOPLEVEL_RESIZE_EDGE_BOTTOM; break; - default: - assert(0); } if (edges != XDG_TOPLEVEL_RESIZE_EDGE_NONE) {