Wayland: Cleanup

This commit is contained in:
Camilla Löwy 2024-02-08 00:05:29 +01:00
parent ea6dd72c71
commit 6ac0835ad2

View File

@ -1431,9 +1431,6 @@ static void pointerHandleButton(void* userData,
uint32_t state) uint32_t state)
{ {
_GLFWwindow* window = _glfw.wl.pointerFocus; _GLFWwindow* window = _glfw.wl.pointerFocus;
int glfwButton;
uint32_t edges = XDG_TOPLEVEL_RESIZE_EDGE_NONE;
if (!window) if (!window)
return; return;
@ -1441,21 +1438,17 @@ static void pointerHandleButton(void* userData,
{ {
_glfw.wl.serial = serial; _glfw.wl.serial = serial;
/* Makes left, right and middle 0, 1 and 2. Overall order follows evdev
* codes. */
glfwButton = button - BTN_LEFT;
_glfwInputMouseClick(window, _glfwInputMouseClick(window,
glfwButton, button - BTN_LEFT,
state == WL_POINTER_BUTTON_STATE_PRESSED state == WL_POINTER_BUTTON_STATE_PRESSED,
? GLFW_PRESS _glfw.wl.xkb.modifiers);
: GLFW_RELEASE,
_glfw.wl.xkb.modifiers);
return; return;
} }
if (button == BTN_LEFT) if (button == BTN_LEFT)
{ {
uint32_t edges = XDG_TOPLEVEL_RESIZE_EDGE_NONE;
switch (window->wl.fallback.focus) switch (window->wl.fallback.focus)
{ {
case GLFW_TOP_DECORATION: case GLFW_TOP_DECORATION:
@ -1484,8 +1477,6 @@ static void pointerHandleButton(void* userData,
else else
edges = XDG_TOPLEVEL_RESIZE_EDGE_BOTTOM; edges = XDG_TOPLEVEL_RESIZE_EDGE_BOTTOM;
break; break;
default:
assert(0);
} }
if (edges != XDG_TOPLEVEL_RESIZE_EDGE_NONE) if (edges != XDG_TOPLEVEL_RESIZE_EDGE_NONE)
{ {