From b8376bd631a72f7484c24663699a7d4c813f600e Mon Sep 17 00:00:00 2001 From: srdusr <99972264+srdusr@users.noreply.github.com> Date: Sun, 17 Aug 2025 01:54:00 +0200 Subject: 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. --- crates/wayland/src/state/mod.rs | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'crates/wayland/src/state/mod.rs') diff --git a/crates/wayland/src/state/mod.rs b/crates/wayland/src/state/mod.rs index 66f9ec6..0fb303e 100644 --- a/crates/wayland/src/state/mod.rs +++ b/crates/wayland/src/state/mod.rs @@ -372,6 +372,14 @@ pub(crate) struct CompState { /// `DesktopIcon::id` instead of `WindowId` since a desktop icon isn't /// a window - see `CompState::is_double_click`'s own doc comment. pub(crate) last_icon_click: Option<(String, u32)>, + /// An in-progress inline rename: the icon's own id, and the live- + /// edited name buffer - same shape as `NativeLock::password` + /// (`native_lock.rs`), the existing precedent for redirecting real + /// keyboard input into a plain string buffer instead of the normally- + /// focused client. `None` whenever no rename is in progress; the + /// keyboard handler checks this the same way it already checks + /// `state.lock.locked`. + pub(crate) renaming_icon: Option<(String, String)>, pub(crate) wm: Rc>, pub(crate) surface_to_id: HashMap, pub(crate) id_to_window: HashMap, -- cgit v1.2.3