From cbd1fc7ee6dced7ad6beecd5b9ad56a7f977f0c4 Mon Sep 17 00:00:00 2001 From: Berke Güzel Date: Tue, 13 Oct 2026 16:57:59 +0300 Subject: Report held pointer buttons on every pointer event Pointer events set button only on press and release, so wsap_term tracked held buttons itself to tell a drag from a hover. yasl_pointer_event.buttons now holds a YASL_BUTTON_BIT() mask of the buttons held after each event. The common input queue tracks it from the DOWN and UP events it queues, and clears it on INPUT_RESET and on allocation failure. Wayland also clears it on leave, since the compositor sends leave during a press only when it takes the pointer and no release follows. X11 and Cocoa keep it, because they deliver motion and the release to the pressed window after leave. Co-Authored-By: Claude Opus 5.5 --- src/platform/wayland/popup.c | 1 + src/platform/wayland/surface.c | 2 ++ 2 files changed, 3 insertions(+) (limited to 'src/platform/wayland') diff --git a/src/platform/wayland/popup.c b/src/platform/wayland/popup.c index cb578d5..44c7206 100644 --- a/src/platform/wayland/popup.c +++ b/src/platform/wayland/popup.c @@ -138,6 +138,7 @@ struct wayland_surface *wayland_surface_create_popup(struct wayland_surface *par return NULL; w->base.display = &c->base; w->base.state = YASL_STATE_CSD; + w->input.leave_ends_press = true; w->conn = c; w->conn_next = c->surfaces; c->surfaces = w; diff --git a/src/platform/wayland/surface.c b/src/platform/wayland/surface.c index b17d203..0f6d7d7 100644 --- a/src/platform/wayland/surface.c +++ b/src/platform/wayland/surface.c @@ -298,6 +298,8 @@ uint32_t wayland_display_caps(const struct wayland_display *c) static void conn_link(struct wayland_display *c, struct wayland_surface *w) { w->base.display = &c->base; + /* The compositor sends leave during a press only when it takes the pointer. */ + w->input.leave_ends_press = true; w->conn = c; w->conn_next = c->surfaces; c->surfaces = w; -- cgit v1.2.3