Overview (Exposé): every window side by side when the launcher opens, or alone on Super+W
CI / test (push) Successful in 1m35s
CI / test (push) Successful in 1m35s
Opening the launcher (Super tap or its panel button) now also shows every window of the workspace scaled down beside it, over the dimmed wallpaper, like GNOME's Activities overview: a natural layout (rows, one scale, aspect ratios kept, never enlarged), minimized windows dimmed, windows gliding in and out over 220 ms. Hover lights a window and shows a close button; click brings it forward and closes the overview and launcher; middle-click closes the window; Escape or a click on empty space closes it. Typing in the launcher's search fades the windows whose title and app id don't match. - compositor/host/overview.mbt: layout, area beside the launcher, hit testing, easing, input and draw ops; previews reuse the Alt+Tab thumbnails (10 fps refresh, nothing redrawn once settled). - New shortcut "overview" (Super+W) in the shortcut table, rebindable in Settings > Shortcuts. - chandra-ctl / control socket: "shortcut ID" runs any shortcut by id. - Both renderers keep only one large scaled copy per image (a gliding preview is drawn at a new size every frame) and draw images up to 4096 px. - Tests: layout packing and aspect ratio, balance, hit testing, animation, Super tap + click, Super+W + Escape/empty click, search filter, middle click, inspector, control command; screenshots of 1/4/9 windows in dark and light. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DPL5hgo3PfGPY8wwv21ZZS
This commit is contained in:
15 files changed
+1321
-10
No files matched your search
@@ -99,6 +99,10 @@ pub(all) struct ChandraCompositor {
|
||||
/// Preview image handles of closed windows, reused for the next ones.
|
||||
thumb_free : Array[UInt]
|
||||
mut alt_down : Bool
|
||||
/// The window overview (overview.mbt) while it is on screen, and whether the launcher was open
|
||||
/// when last looked at (opening it opens the overview).
|
||||
mut overview : Overview?
|
||||
mut launcher_was_open : 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.
|
||||
mut last_frame : @renderer.Pixmap?
|
||||
@@ -234,6 +238,8 @@ pub fn ChandraCompositor::new(
|
||||
switcher_on: false,
|
||||
switcher: [],
|
||||
switcher_sel: 0,
|
||||
overview: None,
|
||||
launcher_was_open: false,
|
||||
thumbs: {},
|
||||
thumb_free: [],
|
||||
alt_down: false,
|
||||
@@ -634,6 +640,7 @@ pub fn ChandraCompositor::has_timed_work(self : ChandraCompositor) -> Bool {
|
||||
self.shot_toast is Some(_) ||
|
||||
self.auth_animating() ||
|
||||
self.thumbs_pending() ||
|
||||
self.overview_animating() ||
|
||||
self.shell.animating()
|
||||
}
|
||||
|
||||
@@ -673,10 +680,13 @@ fn ChandraCompositor::build_scene(
|
||||
self : ChandraCompositor,
|
||||
) -> (@scene.SceneGraph, Bool) {
|
||||
self.flush_configures()
|
||||
self.overview_sync()
|
||||
let scene = @scene.SceneGraph::new(self.output_w, self.output_h)
|
||||
let order = self.wm.stacking_order()
|
||||
// The overview draws the windows itself, as previews.
|
||||
let shown = if self.overview is Some(_) { [] } else { order }
|
||||
|
||||
for wid in order {
|
||||
for wid in shown {
|
||||
match self.windows.get(wid) {
|
||||
Some(win) => {
|
||||
let (insets, deco_ops) = @scene.build_breeze_decoration(
|
||||
@@ -707,7 +717,7 @@ fn ChandraCompositor::build_scene(
|
||||
// Client menus would draw above the auth dialog: none while it is up.
|
||||
for p in (if self.auth is Some(_) { [] } else { self.popups }) {
|
||||
match p.surface {
|
||||
Some(snap) => scene.popups.push((self.popup_rect(p), snap))
|
||||
Some(snap) => if self.overview is None { scene.popups.push((self.popup_rect(p), snap)) }
|
||||
None => ()
|
||||
}
|
||||
}
|
||||
@@ -760,7 +770,11 @@ fn ChandraCompositor::build_scene(
|
||||
self.shell.screenshot_state = (if self.rec is Some(_) { 1 } else { 0 }) |
|
||||
(if self.rec_pointer { 2 } else { 0 })
|
||||
let t0 = @sys.monotonic_ms()
|
||||
let (bg_ops, panel_ops) = self.shell.render(self.output_w, self.output_h, self.theme)
|
||||
let (bg_ops, shell_ops) = self.shell.render(self.output_w, self.output_h, self.theme)
|
||||
// The overview goes under the panel and the launcher.
|
||||
self.overview_sync()
|
||||
let panel_ops = self.overview_ops()
|
||||
panel_ops.append(shell_ops)
|
||||
if self.switcher_on {
|
||||
panel_ops.append(self.switcher_ops())
|
||||
}
|
||||
@@ -1384,6 +1398,9 @@ pub fn ChandraCompositor::handle_input(
|
||||
self.shell.set_hover(id, xi, yi)
|
||||
return
|
||||
}
|
||||
if self.overview_motion(xi, yi) {
|
||||
return
|
||||
}
|
||||
if self.title_bar_motion(xi, yi) {
|
||||
return
|
||||
}
|
||||
@@ -1441,6 +1458,9 @@ pub fn ChandraCompositor::handle_input(
|
||||
}
|
||||
None => ()
|
||||
}
|
||||
if self.overview is Some(_) {
|
||||
return // nothing scrolls under the overview
|
||||
}
|
||||
if axis == 0U && self.shell.inspecting() {
|
||||
// ~10 units per wheel notch -> 3 lines.
|
||||
let lines = if v > 0.0 { (v / 10.0).to_int() + 1 } else { (v / 10.0).to_int() - 1 }
|
||||
@@ -1497,6 +1517,9 @@ pub fn ChandraCompositor::handle_input(
|
||||
}
|
||||
return
|
||||
}
|
||||
if self.overview_button(button, pressed, xi, yi) {
|
||||
return
|
||||
}
|
||||
if !pressed && button == 272U {
|
||||
self.title_bar_release()
|
||||
}
|
||||
@@ -1603,6 +1626,8 @@ pub fn ChandraCompositor::handle_input(
|
||||
self.super_solo = false
|
||||
self.super_tap()
|
||||
}
|
||||
} else if self.overview_key(code, pressed) {
|
||||
self.super_solo = false
|
||||
} else if self.shell.inspecting() {
|
||||
self.super_solo = false
|
||||
// Escape leaves inspect mode; other keys are not forwarded while inspecting.
|
||||
|
||||
Reference in new issue
Block a user