The switcher is now a grid of cards: a scaled-down picture of each window's last frame over its app icon and title, the selected card lit. Cards wrap into rows and shrink to fit small screens. - Previews keep the buffer's aspect ratio and are never enlarged. - Minimized windows show the last frame they drew, dimmed, marked "minimized". A window with no buffer yet shows its app icon (or its initial) on a plain tile. - Cheap: nothing is scaled while the switcher is closed. A preview is made when the switcher opens and again only when that window commits a new buffer (or its shown size changes), into the same image handle; handles of closed windows are reused. The native scaler samples at most 3x3 points per preview pixel, so big windows cost about the same as small. - Both hosts: native scales the wl_shm snapshot in the software renderer (renderer.shm_thumbnail + set_image); the wasm compositor asks the host with the new chandra:host/raster thumbnail(surface, w, h, reuse), which scales the captured surface natively, so no pixels cross the boundary. - Frames the screenshot overlay held back mark previews stale too. Tests: switcher_test (preview pixels, aspect, no-buffer, stale and remade into the same handle, minimized), renderer shm_thumbnail/set_image, host-wasm thumbnail scaling and handle reuse. Pre-existing failures on main are unchanged (6 panel-module host tests, the screenshot panel module test, host-wasm translucent_surfaces_blend). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DPL5hjDvAsSQUdTTUGA3n5
This commit is contained in:
16 files changed
+528
-50
No files matched your search
@@ -75,6 +75,10 @@ pub(all) struct ChandraCompositor {
|
||||
mut switcher_on : Bool
|
||||
mut switcher : Array[UInt64]
|
||||
mut switcher_sel : Int
|
||||
/// The switcher's window previews (switcher.mbt), by window; kept while the window lives.
|
||||
thumbs : Map[UInt64, SwitcherThumb]
|
||||
/// Preview image handles of closed windows, reused for the next ones.
|
||||
thumb_free : Array[UInt]
|
||||
mut alt_down : Bool
|
||||
/// Milliseconds spent so far in the shell (panel modules) and in the rasteriser, for --profile.
|
||||
/// The last composed frame and what it was made from: an unchanged desktop is not redrawn.
|
||||
@@ -169,6 +173,8 @@ pub fn ChandraCompositor::new(
|
||||
switcher_on: false,
|
||||
switcher: [],
|
||||
switcher_sel: 0,
|
||||
thumbs: {},
|
||||
thumb_free: [],
|
||||
alt_down: false,
|
||||
last_frame: None,
|
||||
last_sig: None,
|
||||
@@ -413,6 +419,7 @@ pub fn ChandraCompositor::step(self : ChandraCompositor) -> Unit {
|
||||
} else {
|
||||
release_snapshot(win.surface)
|
||||
win.surface = Some(s)
|
||||
self.thumb_stale(wid)
|
||||
self.damage.mark_rect(win.geometry)
|
||||
}
|
||||
None => ()
|
||||
@@ -476,6 +483,7 @@ pub fn ChandraCompositor::step(self : ChandraCompositor) -> Unit {
|
||||
Some(win) => release_snapshot(win.surface)
|
||||
None => ()
|
||||
}
|
||||
self.thumb_forget(wid)
|
||||
ignore(self.windows.remove(wid))
|
||||
release_snapshot(self.shot_frozen.get(wid))
|
||||
self.shot_frozen.remove(wid)
|
||||
|
||||
Reference in new issue
Block a user