wlr-layer-shell: skip pre-commit validation for destroyed surfaces - #2071
Open
BVMiko wants to merge 1 commit into
Open
wlr-layer-shell: skip pre-commit validation for destroyed surfaces#2071BVMiko wants to merge 1 commit into
BVMiko wants to merge 1 commit into
Conversation
Member
Hmm, I am not sure this is fully correct. We obviously don't want to validate any state that would be specific to the layer-surface (like geometry or anchors), but attaching a null buffer actually has an effect further down the commit hook, which is resetting the unmapped surface for another initial configure. Arguably gtk4-layer-shell should really send the unmap (null-buffer commit) before destroying the surface, but we can work-around it. |
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.
Description
I hit an issue while using gtk4-layer-shell: the client gets disconnected the moment it hides a layer-shell window.
To hide a window, gtk4-layer-shell destroys the
zwlr_layer_surface_v1and then commits thewl_surface(with a nil buffer).On destroy the cached layer state is reset to defaults (size 0, no anchors), but the pre-commit hook is still attached to the surface, so that commit runs it. The state now matches the
pending.size.w == 0 && !pending.anchor.anchored_horizontally()check, which posts InvalidSize ("width 0 requested without setting left and right anchors") and takes down the whole client.This PR just skips the pre-commit validation once the
zwlr_layer_surface_v1has been destroyed. It only short-circuits the hook; it doesn't affect how the surface is torn down.Checklist