scene: only send leave events to outputs with matching scene root

In handling scene buffer output updates, wlroots would send a leave event to
all entered outputs, even those that the scene root for the scene output update
event did not own. Leaving the output list inaccurate.

Sending leave events only for the given scene introduces a problem, though:
existing logic to de-duplicate leave events stops us from sending a leave event
when we leave all the outputs in a scene, and when the surface then becomes
visible in another scene, the frame pacing output cannot be selected
accurately. This breaks screen capture for off-screen windows in sway.

So, let us also mark outputs that would have been left but were spared by the
deduplication logic as "suspended" indicating they are ineligible as frame
pacing outputs.

Fixes: https://github.com/swaywm/sway/issues/9094
(cherry picked from commit e532b4c26c)
This commit is contained in:
Ronan Pigott 2026-03-26 20:04:25 -07:00 committed by Simon Zeni
parent ac378cea41
commit 9d3ec642c2
2 changed files with 22 additions and 9 deletions

View file

@ -127,6 +127,8 @@ struct wlr_surface_output {
struct {
struct wl_listener bind;
struct wl_listener destroy;
bool suspended;
} WLR_PRIVATE;
};