From 8fb4083416d4fb27f7b7ea62334466c93817e38b Mon Sep 17 00:00:00 2001 From: lkn Date: Sat, 23 May 2026 13:31:44 +0200 Subject: [PATCH] fix: titlebar buttons not responding to clicks on Wayland MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit frame_buf_button_at() used fb->scene_buf->buffer as the filter to distinguish invisible button sub-windows from visible titlebar/resizebar nodes. But wlr_scene_buffer_create() sets an initial buffer reference, so scene_buf->buffer was never NULL for buttons — causing the hit-test to skip all of them. The correct distinguisher is node.enabled: buttons have their scene node disabled (they are composited into the titlebar buffer by wl_frame_paint_button), while titlebars/resizebars have enabled nodes. --- src/backend/wayland/wl_backend.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/backend/wayland/wl_backend.c b/src/backend/wayland/wl_backend.c index 2534807..6b05e96 100644 --- a/src/backend/wayland/wl_backend.c +++ b/src/backend/wayland/wl_backend.c @@ -3966,7 +3966,7 @@ frame_buf_button_at(int px, int py) wl_list_for_each(fb, &wl_state.frame_list, link) { if (!fb->parent_id) continue; /* top-level root */ if (!fb->scene_buf) continue; /* no scene node */ - if (fb->scene_buf->buffer) continue; /* has active pixels — titlebar/resizebar */ + if (fb->scene_buf->node.enabled) continue; /* visible node — titlebar/resizebar */ if (px < fb->x || px >= fb->x + fb->width) continue; if (py < fb->y || py >= fb->y + fb->height) continue; /* Prefer the smallest (most specific) enclosing fb. */