From 27daed83230eaefd0f41461cad20bbed7d1ad575 Mon Sep 17 00:00:00 2001 From: srdusr <99972264+srdusr@users.noreply.github.com> Date: Fri, 15 May 2026 19:05:00 +0200 Subject: Fix the maximize border on the path that actually runs, and three spawn faults The maximize border was still drawn because the earlier fix landed on the wrong branch. udev/render.rs has three border blocks: the SRDWM_GPU=1 path at the top and two Pixman ones below. The patch replaced the first match in the file, which is the GPU branch a real DRM session never runs. All four sites across both backends are now gated on !maximized. The verification had failed twice for a separate reason: winit/capture.rs did not draw border strips at all, so a screenshot could never answer "is there a border here" and the control passed for the wrong reason. Border strips are now drawn into that pass as solid fills - corner rounding is not reproduced, so a capture is not pixel-exact at the corners, but presence, position, thickness and colour are. With that closed the test has a real control: unmaximized gives 6 accent pixels at x=800..805, exactly the configured border_width, and maximized gives none at the right edge or along the top row. That proves the winit path; the Pixman path is the same change at two more sites and is not separately confirmed on screen. Windows spawning as squares, partly off-screen, and always on the left were all SmartPlacement::grid. It returned size.min(cell), shrinking every window to its grid cell whatever size it asked for; it scanned cells in reading order and took the first free one, which is the leftmost; and nothing clamped the result, so a window larger than its cell could hang off the edge with its border out of view. The cell now decides only where a window goes, the scan starts from a rotating cell, and both grid and cascade clamp into the usable area. Four tests, one per reported symptom. 525 tests pass, clippy clean. --- crates/wayland/src/state/mod.rs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'crates/wayland/src/state') diff --git a/crates/wayland/src/state/mod.rs b/crates/wayland/src/state/mod.rs index fee7af3..5c1b02e 100644 --- a/crates/wayland/src/state/mod.rs +++ b/crates/wayland/src/state/mod.rs @@ -589,6 +589,12 @@ pub(crate) struct CompState { /// one drag is in progress at a time. See /// `elements::snap_preview_elements`. pub(crate) snap_preview_buffers: Vec, + /// Persistent solid-colour buffers for the border strips drawn into the + /// winit backend's screencopy pass - same stable-`Id` reasoning as + /// `border_side_buffers`. One shared pool rather than one per window: + /// a capture pass runs to completion in a single frame, so nothing + /// needs to persist per window between windows. + pub(crate) capture_border_buffers: Vec, /// Persistent solid-colour buffer backing the whole-output night-light/ /// reading-mode overlay, one per output name - same "reuse the buffer /// so its `Id` stays stable across frames" reasoning as `border_side_ -- cgit v1.2.3