Repository navigation
fix(wayland): share layer-shell registry and bound globals per display - #2628
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
wl_registryand one bound proxy per singleton Wayland global (wl_compositor,zwlr_layer_shell_v1,wp_cursor_shape_manager_v1,zwp_text_input_manager_v3,xdg_activation_v1) and per requestedwl_outputacross every layer-shell overlay on the samewl_display(crates/rune/src/platform/layer_shell/globals.rs,crates/rune/src/platform/layer_shell_machine/globals_pool.rs).SharedGlobalsHandleonOverlayCoreso single-overlay apps (no persistent bar) keep the shared globals alive across hide/show cycles without creating a newwl_registryor re-bindingwl_compositor, while releasing all shared globals cleanly once the last holder drops (or evicting on fatal display error).wl_seatbound per surface (released on drop) and track shared inner-queue drains (DrainTracker) so siblingLayerSurfaceandPendingActivationTokenqueues never misshas_pending_events()after a peer drains libwayland's shared C queue.wl_registry.global_removeto release cachedwl_outputand optional manager proxies immediately when removed.Fixes #2455
Verification
cargo check -p rune --lib,cargo test -p rune --lib layer_shell_machine(45 passed, including 4 new cross-platformglobals_pooltests), andbash scripts/file-size.sh(0 errors, 0 folder-shape issues) locally on Windows.crates/rune/src/platform/layer_shell/globals_tests.rs(showing_and_hiding_binds_no_global_again_with_or_without_wl_fixes,peer_surface_reports_pending_events_after_sibling_drains_shared_connection,global_remove_releases_cached_output_and_rebinds_replacement); verified Linux compilation via CIcheck. Live Wayland compositor hardware (such as niri) was not run locally.