From 7fb3347bb04a8668f7dd9a2bb39eafa6583ac4d6 Mon Sep 17 00:00:00 2001 From: haffel Date: Sat, 12 Sep 2026 13:57:45 +0200 Subject: [PATCH] Stabilize popup focus opacity --- .agents/CLIPBHOARD_HARDENING_CHECKLIST.md | 7 ++++--- src/gui.rs | 5 +++++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/.agents/CLIPBHOARD_HARDENING_CHECKLIST.md b/.agents/CLIPBHOARD_HARDENING_CHECKLIST.md index b93944b..ec0d48d 100644 --- a/.agents/CLIPBHOARD_HARDENING_CHECKLIST.md +++ b/.agents/CLIPBHOARD_HARDENING_CHECKLIST.md @@ -62,9 +62,10 @@ Each bounded iteration must: - [ ] Make popup close hide the window while the background process continues (code path added; desktop verification pending). - [ ] Center the popup on the configured/active monitor. - [x] Keep the X11 popup above other windows and apply 30% opacity while it is - inactive, returning to full opacity when focused (27 X11-feature tests and - Docker GTK/X11/package build, 2026-09-12); compositor behavior remains live - desktop evidence. + inactive, returning to full opacity when focused; recheck after mapping and + every 100 ms to cover Cinnamon/GTK4 focus-notification races (27 X11-feature + tests and Docker GTK/X11/package build, 2026-09-12); compositor behavior + remains live desktop evidence. - [x] Preserve search query and surviving selection after refresh-triggering actions (17 core tests and Docker GTK/X11 build, 2026-09-10). - [ ] Keep keyboard pause state synchronized with button and status text. - [ ] Implement complete keyboard-first navigation and commands. diff --git a/src/gui.rs b/src/gui.rs index 92dcabc..84e440f 100644 --- a/src/gui.rs +++ b/src/gui.rs @@ -182,6 +182,11 @@ fn build_window( window.connect_is_active_notify(move |_| { crate::platform::linux::x11_window::set_active_opacity(&window_for_opacity); }); + let window_for_opacity = window.clone(); + glib::timeout_add_local(std::time::Duration::from_millis(100), move || { + crate::platform::linux::x11_window::set_active_opacity(&window_for_opacity); + glib::ControlFlow::Continue + }); window.set_title(Some(&format!("Cliphoard — {}", config.global_shortcut))); pause_button.set_tooltip_text(Some("Pause/resume recording: Ctrl+Alt+R")); let window_for_close = window.clone();