diff options
| author | srdusr <[email protected]> | 2025-08-17 01:54:00 +0200 |
|---|---|---|
| committer | srdusr <[email protected]> | 2025-08-17 01:54:00 +0200 |
| commit | b8376bd631a72f7484c24663699a7d4c813f600e (patch) | |
| tree | c8c84725e3c66598df3f619dd96aa69b6eede26e /crates/core/src/manager | |
| parent | bd6aadf4d166c05f22f1ab6cdfe2e815e071f162 (diff) | |
| download | srdwm-b8376bd631a72f7484c24663699a7d4c813f600e.tar.gz srdwm-b8376bd631a72f7484c24663699a7d4c813f600e.zip | |
Fix desktop icons v1 regressions: bar overlap, wrong order; add proper menus
Live testing found v1 genuinely broken, not just rough:
1. Icons weren't rendering reliably at all - ensure_desktop_icons only
ever computed the grid's origin once, on whichever render pass
happened to be first. AGS's own top bar registers its exclusive zone
after that first pass, so origin got permanently baked in at the
pre-bar geometry. Confirmed live via a temporary diagnostic log.
Fixed by re-deriving origin from the primary monitor's current
geometry on every call instead of just the first.
2. Fixed icons (Home/Computer/Trash) always sorted before real files --
confirmed wrong via direct question. The whole list now sorts
alphabetically by label, case-insensitive, fixed icons included.
3. "Set as Wallpaper" was the wrong feature: removed entirely
(DesktopMenuAction::SetWallpaper, general.wallpaper_command,
is_image_path). The user wants that handled by their real file
manager once opened, not reimplemented here.
Also adds real menu functionality per "where are all the options":
Rename (inline text edit, new CompState::renaming_icon field and
keyboard redirect mirroring NativeLock::password's existing precedent),
Delete (moves to ~/.local/share/Trash per the freedesktop.org spec, new
trash.rs module, same-filesystem case, no confirmation - this is the
reversible move-to-trash, not a permanent delete), Empty Trash on the
Trash icon, and Open Terminal Here / Open in File Manager on the
bare-desktop menu (new general.terminal config key).
133 wayland-crate tests (up from 106), full workspace build and clippy
clean.
Diffstat (limited to 'crates/core/src/manager')
| -rw-r--r-- | crates/core/src/manager/mod.rs | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/crates/core/src/manager/mod.rs b/crates/core/src/manager/mod.rs index c2f67e4..848eca5 100644 --- a/crates/core/src/manager/mod.rs +++ b/crates/core/src/manager/mod.rs @@ -231,16 +231,12 @@ pub struct WindowManager { /// file managers) default the other way, hence this being a real /// config option rather than a hardcoded choice. pub desktop_icon_single_click: bool, - /// External program a desktop image-file icon's "Set as Wallpaper" - /// action shells out to, read from `general.wallpaper_command`. Empty - /// (the default) means that action doesn't appear at all - srdwm - /// never draws the wallpaper itself (an external layer-shell client's - /// job, see `WaylandState`'s own doc comment on viewporter), so unlike - /// `file_manager`'s `xdg-open` fallback there is no universal command - /// to guess here; the user names their own wallpaper tool (`swww img`, - /// `awww img`, ...) or the action stays hidden rather than silently - /// doing nothing when clicked. - pub wallpaper_command: String, + /// External program the bare-desktop menu's "Open Terminal Here" + /// action shells out to (with `~/Desktop` as its working directory), + /// read from `general.terminal`. Empty (the default) tries a short + /// list of common terminals on `$PATH` - there's no `xdg-open`- + /// equivalent for "a shell", unlike `file_manager`. + pub terminal: String, /// The whole-screen colour treatment currently active (night light's /// warm tint or reading mode's desaturation), live-settable via `srd /// set night_light`/`srd set reading_mode` - see [`ColorFilter`]. Off @@ -405,7 +401,7 @@ impl WindowManager { desktop_icons_enabled: true, file_manager: String::new(), desktop_icon_single_click: false, - wallpaper_command: String::new(), + terminal: String::new(), color_filter: ColorFilter::None, focus_follows_mouse: false, auto_raise: false, |