From d2a4a638e4a929500ef453917622da74276ccace Mon Sep 17 00:00:00 2001 From: Johan Malm Date: Sat, 6 Jun 2026 09:27:51 +0100 Subject: [PATCH] Revert "scene: ignore outputs with too small intersection with nodes" This reverts commit 95b2771bfd096cd8b3a3212c1ba0e1026f410cc4 ...to fix lxqt-panel auto-hiding which is currently broken when the panel size is greater than 40 (height when panel is in horizontal mode). This is because lxqt-panel has a `#define PANEL_HIDE_SIZE 4` which means it is ignored by the compositor because of `if (overlap >= 0.1 * visible_area) { ...` in `update_node_update_outputs()` in `wlr_scene.c`. Have tested this patch on the wlroots-0.20 branch with labwc-0.20.0 and confirm it fixes the auto-hiding issue. Ref: - https://github.com/labwc/labwc/issues/3600 - https://gitlab.freedesktop.org/wlroots/wlroots/-/commit/95b2771bfd096cd8b3a3212c1ba0e1026f410cc4 - https://github.com/lxqt/lxqt-panel/blob/78e5e279ccf6d986d92ddc67f470966b24f0120e/panel/lxqtpanellimits.h#L34 Note: `git revert 95b2771` resulted in many conflicts, so this patch includes significant manual editing. --- types/scene/wlr_scene.c | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/types/scene/wlr_scene.c b/types/scene/wlr_scene.c index 7e4a81004..ad3f802a3 100644 --- a/types/scene/wlr_scene.c +++ b/types/scene/wlr_scene.c @@ -417,8 +417,6 @@ static void update_node_update_outputs(struct wlr_scene_node *node, uint64_t active_outputs = 0; if (!pixman_region32_empty(&node->visible)) { - uint32_t visible_area = region_area(&node->visible); - // let's update the outputs in two steps: // - the primary outputs // - the enter/leave signals @@ -449,17 +447,13 @@ static void update_node_update_outputs(struct wlr_scene_node *node, uint32_t overlap = region_area(&intersection); pixman_region32_fini(&intersection); - // If the overlap accounts for less than 10% of the visible node area, - // ignore this output - if (overlap >= 0.1 * visible_area) { - if (overlap >= largest_overlap) { - largest_overlap = overlap; - scene_buffer->primary_output = scene_output; - } - - active_outputs |= 1ull << scene_output->index; - count++; + if (overlap >= largest_overlap) { + largest_overlap = overlap; + scene_buffer->primary_output = scene_output; } + + active_outputs |= 1ull << scene_output->index; + count++; } }