Repository navigation
Glass: take a capture pleamar-wm drew without our surface as the background as is - #139
Merged
Merged
Conversation
…d as it is pleamar-wm marks a screencopy frame with flag 1<<16 when it left out the surfaces of the program that asked. Nothing of ours is then unmixed from it (opacity 0 in the unmix), so the holes under our opaque parts are gone.
Owner
|
Thanks, merged both. I first worried that leaving the asker out would also change what a window recording the screen gets, but windows are the scene's own in pleamar-wm, so only programs with layer surfaces on that monitor are affected, and for them this is what glass wants. I reproduced it headless: a striped background, and a |
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 happened
With
dome:on, glass with large opaque things drawn on it showed dark blocks offset outward from them. The Vitreus Settings wallpaper grid is one example. The cause is the unmix,capture = ours + (1 − α) · background: under our own opaque pixels nothing of the background is left in the capture.unmix_atmarks those pixels unknown (alpha 0), and frost fills small holes such as text, but not a 96×54 thumbnail. A dome samples nearer the middle, so the glass beside a picture looks into its neighbour's hole.The change
The real fix is in the compositor, which knows what is behind us: k4ditano/pleamar-wm#44 draws a program's screencopy picture without its own surfaces (and without anything above them) and sets a new frame flag bit,
WITHOUT_YOU = 1 << 16.Here,
CaptureForreadsflags. The bit comes through asWEnum::Unknown, since it is not in the protocol's enum. When it is set, the capture is handed to the render withopacity: 0.0. Inunmix_atthat makess = 0andremaining = 1, so the background is the capture as it is: no unknown holes, and no "capture is of another frame" rejections either.Without the bit (Hyprland, niri, an older pleamar-wm) nothing changes.
Tested
cargo test --release: 194 passed.🤖 Generated with Claude Code