Repository navigation
fix(wayland): stop aborting on a subsurface without a parent - #135
Merged
Merged
Conversation
A `wl_surface` whose `wl_subsurface` was destroyed still reports the `subsurface` role: Smithay's `unset_parent` only clears the parent link, leaving `role == SUBSURFACE_ROLE`. `construct_subsurface_role_message` then unwrapped `get_parent()`, so a later commit of that surface — or the shell-reload resend in `on_shell_ready` — hit `None` and panicked inside Wayland request dispatch. That dispatch cannot unwind, so the panic aborted the whole compositor instead of failing one request (issue #132). Return `None` from `construct_subsurface_role_message` when the parent is gone and treat the surface as roleless on both call paths. The shell already handles a null role.
This was referenced Oct 14, 2026
Merged
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.
What
Fixes the crash reported in #132.
The log's real failure is not the recurring
font-weighterrors but:Column 57 of that line is the
.unwrap()in:src/embedder/state.rs,State::construct_subsurface_role_message. The backtrace shows it running insidewayland_backend::sys::server_impl::resource_dispatcher, i.e. a Wayland request handler. Wayland dispatch cannot unwind, so the panic aborts the whole process instead of failing one request.Root cause
In the pinned Smithay, destroying a
wl_subsurfacecallsPrivateSurfaceData::unset_parent, which onlytake()s the parent link — it leavesrole == SUBSURFACE_ROLEon thewl_surface. So a surface can report the subsurface role whileget_parent()returnsNone.construct_surface_role_messagematched on that role and unwrapped the parent unconditionally. Any later commit of the still-alive surface, or the shell-reload resend inon_shell_ready(which iteratesdata.subsurfaces, still holding the entry), hitNoneand aborted.Fix
construct_subsurface_role_messagenow returnsOption<SubsurfaceMessage>, usingget_parent(surface)?.construct_surface_role_messagemaps through it, so a parentless subsurface yieldsrole = None.on_shell_readyskips the resend when the role message isNone.The shell already treats a null role as roleless (
surface.manager.dart), so this degrades gracefully.Verification
cargo check— clean (only pre-existing warnings).cargo test— 216 passed, 0 failed.cargo fmtapplied.Not part of this fix
The
Bad state: Invalid "font-weight": 596spam comes fromflutter_svg/vector_graphics_compileron a malformed SVG asset and is logged as an unhandled isolate exception; it does not abort the app. Tracked separately.