diff options
Diffstat (limited to 'crates/wayland/src')
| -rw-r--r-- | crates/wayland/src/udev/platform.rs | 21 | ||||
| -rw-r--r-- | crates/wayland/src/winit/nested_platform.rs | 5 |
2 files changed, 26 insertions, 0 deletions
diff --git a/crates/wayland/src/udev/platform.rs b/crates/wayland/src/udev/platform.rs index 2868f15..96d5cf2 100644 --- a/crates/wayland/src/udev/platform.rs +++ b/crates/wayland/src/udev/platform.rs @@ -629,6 +629,25 @@ impl Platform for UdevPlatform { fn apply_geometry(&mut self, window: srdwm_core::WindowId, _geometry: srdwm_core::Rect) -> PlatformResult<()> { self.state.sync_geometry(window); + // `redraw_decoration_buffer` sizes the cached border-strip/titlebar + // bitmaps from `effective_frame`, which (see that function's own + // doc comment) can differ from `w.geometry` alone once a CSD + // client's own invisible shadow margin enters the picture. Without + // this, the bitmap stays sized from whatever it was last built at + // - correct right up until this specific call changes `w.geometry` + // (`toggle_maximize`/`apply_snap_zone`, the two core-side callers of + // this callback) - and the *next* rebuild only happens whenever + // this window's own client next commits (`protocols/compositor.rs`'s + // per-commit call) or something else unrelated triggers one, not + // reliably right away. Confirmed live: maximizing then restoring a + // Chrome window left its border strips sized for the *maximized* + // frame while its real content had already settled back to the + // smaller restored size, immediately and permanently until some + // later unrelated trigger (a fresh commit) happened to catch it up + // - a real, visible gap between content and border on the far + // edges, not the half-pixel seam `blend_corner_pixel`'s own fix + // addressed. + self.state.redraw_decoration_buffer(window); Ok(()) } @@ -660,6 +679,8 @@ impl Platform for UdevPlatform { fn restore(&mut self, window: srdwm_core::WindowId) -> PlatformResult<()> { self.state.sync_geometry(window); + // See `apply_geometry`'s own doc comment - same gap, same fix. + self.state.redraw_decoration_buffer(window); Ok(()) } diff --git a/crates/wayland/src/winit/nested_platform.rs b/crates/wayland/src/winit/nested_platform.rs index 330ef91..316b1b5 100644 --- a/crates/wayland/src/winit/nested_platform.rs +++ b/crates/wayland/src/winit/nested_platform.rs @@ -102,6 +102,10 @@ impl Platform for WaylandPlatform { fn apply_geometry(&mut self, window: WindowId, geometry: srdwm_core::Rect) -> PlatformResult<()> { let _ = geometry; self.state.sync_geometry(window); + // See `udev/platform.rs`'s own `apply_geometry` doc comment - same + // gap (the cached border/titlebar bitmap only rebuilds on a commit, + // focus change, or a few specific paths, not this one), same fix. + self.state.redraw_decoration_buffer(window); Ok(()) } @@ -126,6 +130,7 @@ impl Platform for WaylandPlatform { fn restore(&mut self, window: WindowId) -> PlatformResult<()> { self.state.sync_geometry(window); + self.state.redraw_decoration_buffer(window); Ok(()) } |