50149e6b9980bf78a3f6640a88ed89ac14d945ea
7
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
ae48cc5bf4 |
Applications menu and Icon Desktop: show each app's .desktop icon
CI / test (push) Failing after 2m56s
The launcher's rows drew a letter circle and the Icon Desktop fell back to letter tiles for every app that wasn't in the dock: the shell only published icons for windows' and dock apps. publish_icons now also covers the rows the open Applications menu lists (only those, so opening it looks up a handful of icons) and every catalog app when the desktop module imports icons. Lookups are the dock's (theme chain, absolute Icon= paths, PNG on the native host, SVG too on the wasm host, generic app icon, then the letter tile) and cached per id; an unchanged icons table is no longer re-sent every frame. launcher-widget imports icons; the JS host has an icons stub (always 0). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DPL5hkhaM5djqPXPQNs7QR |
||
|
|
0feea23a06 |
Password dialog: Chandra is its own polkit agent, drawn in the shell layer
CI / test (push) Failing after 18s
run0, pkexec and other polkit prompts used whatever third-party agent was
installed: a plain toolkit window saying "start transient unit
'run-p15802-i1990.service'". The compositor now registers as the session's
polkit authentication agent and asks in its own dialog:
- a centered card over a dimmed screen, above all windows and client menus,
themed (dark/light follow the Dark mode switch), keyboard-first: Enter,
Esc, Tab order, Alt+R show/hide, Alt+D details, Ctrl+U clear
- for run0 it shows the command it will run ("gparted /dev/sda", as root)
from run0's command line (pid from polkit's details or the unit name),
pkexec's command from its details, polkit's message otherwise; Details
lists the requester, target user, unit and action id
- account picker when several admins can answer (group members expanded)
- the PAM conversation through polkit-agent-helper-1: polkit 126's socket
first, else the setuid helper on a socket pair (new sys spawn-socket on the
native, Rust and MoonBit hosts); password, echo-on prompts, info (fingerprint)
and errors (faillock) shown as they come; wrong password shakes and retries;
spinner while PAM checks; Caps Lock warning
- typing through the clients' xkb keymap (groups, Shift, AltGr, Caps Lock),
US layout when there is none
- no client has keyboard focus or input while it is up; the password is
wiped after sending and never logged
Settings > Session > "Chandra password dialog" (state.edn :auth-agent
:system when off) switches back to the third-party agent, which
chandra-session now finds and the compositor starts (also when polkit
refuses our agent). Tests: polkit_test (keymaps, helper protocol, run0
parsing, dialog states, the socket-pair route) and auth_test (mock polkit
Authority on a private dbus-daemon, mock helper; CHANDRA_AUTH_SHOTS writes
a PNG per state). Docs: docs/auth-dialog.md.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DPL5hgkRPrAzXECBUGmNEE
|
||
|
|
114f0b4e04 |
Icons: follow the icon theme spec so KDE apps in the dock get real icons
CI / test (push) Failing after 19s
Pinned KDE apps (Konsole, Dolphin, Kate, KWrite, System Settings) showed letter tiles because their Icon= names a theme icon (utilities-terminal, system-file-manager, preferences-system) that only breeze has, and breeze keeps icons in <context>/<size> (apps/48), which the hard-coded <size>x<size>/apps lookup never looked in. The lookup now reads each theme's index.theme (Directories, sizes, Type, Scale), picks the closest directory as the spec says, searches the user's theme (kdeglobals [Icons] Theme, GTK settings.ini, $CHANDRA_ICON_THEME) and its Inherits chain, then hicolor, then breeze and Adwaita. It also tries the desktop id and its last dotted part, and falls back to the theme's generic application-x-executable icon before the letter tile. Misses are logged. The dock's first pins are now the installed default browser, file manager, terminal and editor (Settings > Apps) instead of the catalog's first five. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DPL5hkNwArmSLRGcuxUMhw |
||
|
|
c45e0ef431 |
Dock: pinned and running apps with real icons, window dots, hover names and a per-app menu
CI / test (push) Failing after 17s
The dock showed the first eight catalog apps as letter tiles, and that list reshuffled after every launch (the catalog puts recent apps first). Now: - Pinned apps first, in the order you set, then the other running apps after a thin divider (like macOS). Windows find their app by desktop id, case, the last dotted part, or the app's name (xterm -> debian-xterm.desktop "XTerm"); windows without an app id stay out. - Real icons from the icon theme (the `icons` capability, as in the task manager), with the letter tile as fallback. The shell publishes icons for pinned apps that aren't running too. - A dot under an icon per open window (up to three), a longer accent bar when the app has focus. - Click: start the app if it isn't running, otherwise bring its newest window forward (restoring it if minimized); click a focused app again to step through its windows. - Hover: the icon grows (neighbours a little) on a light highlight, and the shell draws the app's name in a label above it. - Right-click an icon (drawn by the shell, like the task manager's window menu): Open / New window, Pin to dock / Unpin from dock, Move left / Move right, Quit or Close N windows, and Dock settings. - Dock settings (module-config): Icon size (Small/Medium/Large), Magnify icons under the pointer, Show running apps that aren't pinned. The pinned list is a hidden setting (empty label: the shell's settings menu skips it), saved in state.edn's :module-config. Until it is set the dock pins the catalog's first five, and the shell saves that once so launches don't move them. - The panel sizes the dock from its current items (a module's preferred width is read once). Plumbing: new WIT world dock-widget (app-catalog, app-launch, windows, icons, exports module-config); no new interfaces, so both hosts load it as is. lib/dock holds the items, layout, hit-testing, drawing and pin edits, shared by the module and compositor/shell/dock.mbt. The shell's Launch handling moved into launch_catalog_app so the menu can use it. Also: DesktopShell::pointer_move delivered every hover move twice (a duplicated block). Tests: lib/dock (settings round trip, app matching, item order, hit-testing with the divider, clicks and window cycling, drawing, pin edits), compositor/host input_test (the dock in a real compositor: saved default pins, growing for running apps, hover label, the menu's rows and actions, settings menu without the pinned row, focusing by click), dock_test (screenshots in _build/dock_hover.png and dock_menu.png). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DPL5hkmB8pJF5ckPeecFxL |
||
|
|
bb7c9b947f |
Settings > Apps: choose the default browser, email, files, terminal, editor, viewers and players
CI / test (push) Failing after 45s
- A sixth Settings tab, Apps (key 6, SettingsTab::Apps; the popup is 390 px wide for it): Web
browser, Email, File manager, Terminal, Text editor, Image viewer, Video player, Music player,
PDF and documents, Archive manager. Each row shows the current default with its real icon (the
icon-theme lookup the task manager uses; a letter tile when there is none). Click a row to list
the installed apps that can take it, click one to make it the default. A chosen app that has
been uninstalled since is named in red under its row ("gthumb is not installed any more").
- Installed apps come from the .desktop files in the XDG data dirs (and flatpak's exports), with
MimeType= and Categories= (desktop_entry_keys, now shared with the launcher's parse_desktop).
A kind lists the shown apps that handle one of its MIME types; the terminal lists
TerminalEmulator apps; browsers are only offered as browsers.
- Reading follows the mimeapps.list spec: $XDG_CONFIG_HOME/[chandra-]mimeapps.list, then
$XDG_CONFIG_DIRS (/etc/xdg), then $XDG_DATA_HOME and $XDG_DATA_DIRS applications/; the first
installed [Default Applications] entry wins, else [Added Associations], else mimeinfo.cache
(minus [Removed Associations]), else the first installed app that handles the type. A hidden
(NoDisplay) default still counts and its name is shown.
- Setting writes [Default Applications] in ~/.config/mimeapps.list for each of the kind's MIME
types the app handles (always the main one: http/https/text/html for browsers, mailto,
inode/directory, text/plain, image/png..., video/mp4..., audio/mpeg..., application/pdf...,
application/zip...), as xdg-mime default / xdg-settings do, without running them. Every other
section, entry, comment and blank line is kept; the app leaves those types' [Removed
Associations]; a chandra-mimeapps.list that already names one of those types is updated too.
- The terminal has no MIME type: state.edn :terminal "kitty" (desktop id), also written first in
~/.config/xdg-terminals.list (xdg-terminal-exec). Terminal=true apps from the launcher (and
session restore) now start in it (foot -e, kgx/gnome-terminal/ptyxis --, kitty <cmd>, wezterm
start --) instead of always foot; with no choice: xdg-terminals.list, then foot, then any
installed terminal. Terminal apps are listed when any terminal emulator is installed, not only
foot.
- New `default-apps` capability (categories, apps, set-default, refresh): host tables 11 (sss:
name current missing) and 12 (issii: category id name icon current), request 19 (category *
1000 + app, -1 rescans) in the wasmer/wasmtime stub, host-wasm and the MoonBit wasmhost
(chandra:host/plasmoids default-app(s32)). Nothing is scanned until the tab opens (refresh).
- Tests with a temporary XDG tree: categories and current defaults (user file, system file,
Added Associations, mimeinfo.cache, missing apps, hidden defaults), writing that keeps other
entries, desktop-specific files, the terminal list and commands, the Apps tab end to end, and
the :terminal round trip through state.edn.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DPL5hgywj7RPmFdFhpzGZj
|
||
|
|
51b914f6cf |
Alt+Tab switcher: show a preview of each window
CI / test (push) Failing after 19s
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 |
||
|
|
f2e870c251 |
Task manager: draw each app's real icon from its .desktop file
CI / test (push) Failing after 16s
Each pill now shows the icon the app's .desktop file names (Icon=), looked up in the freedesktop icon themes, instead of the letter tile. The tile stays as the fallback for windows with no app id, no desktop file or no icon the host can read. - WIT: a new `icons` capability (`app-icon(app-id) -> u32`, a handle, never a path or pixels) and an `image(image-op)` draw op (appended, so existing modules keep their ABI). taskbar-widget and plasmoid-host import `icons`. Host raster gains `load-image(path)` and a `draw-image` op; the plasmoids host gets an icons table (6: app id, handle). - Compositor (shell/icons.mbt): window app id -> desktop file (resolve_app_id, so StartupWMClass and last-dotted-part matches work) -> Icon= -> theme lookup (XDG data dirs, ~/.icons, flatpak exports; hicolor, Adwaita, breeze; 48/64/32 px PNG first, then scalable SVG when the host can draw it, then other sizes, then /usr/share/pixmaps). Absolute Icon= paths are used as they are. Results are cached per app id; the table is published only when a module imports `icons`. - wasm host (host-wasm): PNG via the png crate, SVG via resvg (rendered sharp at each size), PNGs area-averaged to the drawn size; loads cached by path. - Native build: a small PNG decoder (compositor/renderer/png.mbt: inflate + filters, 1-16 bit, palettes with tRNS) and the Image op in the software renderer. SVG-only icons fall back to the tile there. The wasmer stub serves `icons.app-icon` from the same table. - Tests: PNG decoder fixtures (all filters, fixed/dynamic/stored blocks, palette), image scaling and drawing, icon lookup order, Icon= parsing, task module icon-or-tile (native and wasmtime), host raster PNG+SVG loading and drawing. Checked end to end with the wasm host: foot's hicolor icon shows on its pill. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DPL5hhmtDt52EjaW8jevGU |