Skip to content

Glass: take a capture pleamar-wm drew without our surface as the background as is - #139

Merged
k4ditano merged 1 commit into
k4ditano:mainfrom
natepayn3:glass-sees-below
Nov 6, 2026
Merged

k4ditano merged 1 commit into
k4ditano:mainfrom
natepayn3:glass-sees-below

Conversation

@natepayn3

Copy link
Copy Markdown
Contributor

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_at marks 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, CaptureFor reads flags. The bit comes through as WEnum::Unknown, since it is not in the protocol's enum. When it is set, the capture is handed to the render with opacity: 0.0. In unmix_at that makes s = 0 and remaining = 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.
  • Live with pleamar-wm#44 on a 3080, Vitreus with Dome up: the wallpaper grid's dark blocks are gone, and Live bend still bends and magnifies what is behind. Rebased here onto 0.7.23 and checked to build.

🤖 Generated with Claude Code

…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.
@k4ditano
k4ditano merged commit a1555d2 into k4ditano:main Nov 6, 2026
1 check passed
@k4ditano

k4ditano commented Nov 6, 2026

Copy link
Copy Markdown
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 dome: 90% glass with three opaque boxes drawn on it. 0.7.24 + 0.6.14 showed dark blocks and halos beside each box, and with both PRs it is clean while the dome still bends the stripes. Out in pleamar 0.7.25 and pleamar-wm 0.6.15.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants