Migrate to bread-utils: Hyprland IPC, single-instance lock, popup scaffold, XDG paths

Mirrors tonight's breadbox migration (same shared crate, same duplicated
patterns):

- position.rs's raw socket1 client -> bread_utils::hypr (file removed
  entirely, its logic now lives in the shared crate)
- toggle_or_continue's TOCTOU-prone PID-file dance -> bread_utils::singleton
- the layer-shell window setup, Up/Down visible-row navigation, and
  click-outside-close gesture -> bread_utils::gtk_popup
- breadclip-core's data_dir(): replaced the buggy
  `dirs::data_local_dir().unwrap_or_else(|| PathBuf::from("~/.local/share"))`
  fallback (flagged but never fixed in tonight's earlier audit pass —
  PathBuf never expands `~`) with bread_utils::xdg::data_dir, which
  resolves a real $HOME before ever falling back.

Builds and tests clean across the whole breadclip workspace.
This commit is contained in:
Breadway 2026-07-17 09:24:38 +08:00
parent 8097d1944c
commit e16c1b461c
6 changed files with 47 additions and 172 deletions

View file

@ -8,3 +8,5 @@ rusqlite = { version = "0.31", features = ["bundled"] }
sha2 = "0.10"
hex = "0.4"
dirs = "5"
# TODO(owner): switch to tag-pinned git dependency once bread-utils is merged and tagged, matching the bread-theme pattern
bread-utils = { path = "../../bread-ecosystem-fix-worktree/bread-utils" }