diff options
| author | srdusr <[email protected]> | 2025-04-29 21:05:00 +0200 |
|---|---|---|
| committer | srdusr <[email protected]> | 2025-04-29 21:05:00 +0200 |
| commit | 317b3b269cc526b410b6d0c0666e16ae84832ef9 (patch) | |
| tree | 6f545a814f44c032921ece533b87cca27a79d8c7 /crates/wayland/src/udev/platform.rs | |
| parent | 254557f94544fe8841a4e9422eee9228e7ed4152 (diff) | |
| download | srdwm-317b3b269cc526b410b6d0c0666e16ae84832ef9.tar.gz srdwm-317b3b269cc526b410b6d0c0666e16ae84832ef9.zip | |
Fix border/content misalignment from a stale and double-applied CSD margin
Two bugs in how a CSD client's own declared shadow-margin offset
(dwindow.geometry().loc) drives where its content actually renders,
both surfaced by a real Firefox window:
1. A live Firefox window was observed reporting loc = (-10, -10) --
negative, despite sync_geometry's tiled-state hint telling it to
reserve no margin at all. effective_frame_of already clamps this
value to non-negative for its own size calc; the content-position
code (both the masked-content-buffer test and the real content
push) didn't, so a negative margin shifted content the wrong way --
away from the border, not toward it. Clamped to match.
2. Separately, and the actual cause of a later "border isn't over the
window" report on the same Firefox window (this time reporting
loc = (10, 10)): the masked/rounded content buffer's own build step
already renders the client's surface tree shifted by -content_offset
so the buffer's own (0, 0) lands exactly on the real, margin-
excluded content top-left (see rounded_content_buffer's own loc
parameter). Placing that already-compensated buffer on screen at a
*second* content_offset-shifted position double-applied the
correction, landing it content_offset pixels too far up and left of
the border wrapping it. Confirmed live via pixel sampling: Firefox's
own chrome rendered starting 10px above the border's nominal top
edge, fully exposed, square, with no border over it at all.
Split the single `pos` into `content_pos` (unshifted - what the
already-compensated masked buffer uses) and `pos` (content_pos further
shifted by content_offset - kept only for the surface_content_elements
fallback, which renders the client's raw surface tree with no prior
compensation of its own and still needs the shift applied once).
The winit/GLES backend's equivalent path doesn't have this bug: its
rounded_content_element renders the client's live texture directly at
`location` with no separate pre-shifted buffer, so a single
content_offset-adjusted position there was already correct.
Diffstat (limited to 'crates/wayland/src/udev/platform.rs')
0 files changed, 0 insertions, 0 deletions