fix: titlebar buttons not responding to clicks on Wayland
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.
This commit is contained in:
parent
57a6497137
commit
8fb4083416
|
|
@ -3966,7 +3966,7 @@ frame_buf_button_at(int px, int py)
|
||||||
wl_list_for_each(fb, &wl_state.frame_list, link) {
|
wl_list_for_each(fb, &wl_state.frame_list, link) {
|
||||||
if (!fb->parent_id) continue; /* top-level root */
|
if (!fb->parent_id) continue; /* top-level root */
|
||||||
if (!fb->scene_buf) continue; /* no scene node */
|
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 (px < fb->x || px >= fb->x + fb->width) continue;
|
||||||
if (py < fb->y || py >= fb->y + fb->height) continue;
|
if (py < fb->y || py >= fb->y + fb->height) continue;
|
||||||
/* Prefer the smallest (most specific) enclosing fb. */
|
/* Prefer the smallest (most specific) enclosing fb. */
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue