atagen

monolith

public
Star0
Watch0

Commit d8c816c1987e

tarball

atagen <boss@atagen.co>2026-10-17 04:23 UTC

1 file changed+9-4
monolith: clip shm damage to the buffer before sizing it

Qt clients, quickshell among them, damage a whole surface with an INT32_MAX rectangle. Its area overflowed: debug builds panicked, and release builds wrapped under the offload threshold, so quickshell's full redraws of a 14.7 MB layer were never moved off the main thread.
Modified file: crates/monolith/src/import.rs+9 additions−4 deletions
@@ -138,10 +138,15 @@ impl State {
138138 size: (i32, i32),
139139 client: Client,
140140 ) -> Option<ImportBlocker> {
141- let area = region.map_or(i64::from(size.0) * i64::from(size.1), |r| {
142- i64::from(r.size.w) * i64::from(r.size.h)
143- });
144- if area * 4 < OFFLOAD_BYTES {
141+ // Clients mark everything damaged with an INT32_MAX rectangle, Qt
142+ // among them.
143+ let full = Rectangle::from_size(size.into());
144+ let region = match region {
145+ Some(r) => Some(r.intersection(full)?),
146+ None => None,
147+ };
148+ let r = region.unwrap_or(full);
149+ if i64::from(r.size.w) * i64::from(r.size.h) * 4 < OFFLOAD_BYTES {
145150 return None;
146151 }
147152 let imports = &mut self.services.imports;