From c4fc79c3ee1cd77b37e049898b60862a83cebfc9 Mon Sep 17 00:00:00 2001 From: Matheus Quost Date: Tue, 1 Dec 2026 15:07:05 -0300 Subject: [PATCH 1/3] fix: restore focus before pasting queue items --- crates/menew-ui/src/lib.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/crates/menew-ui/src/lib.rs b/crates/menew-ui/src/lib.rs index e034046..4db2e9b 100644 --- a/crates/menew-ui/src/lib.rs +++ b/crates/menew-ui/src/lib.rs @@ -2055,12 +2055,19 @@ pub mod palette { self.notify("menew-queue", &tr("queue_done", lang, &[]), None); } self.queue_changed(); + // The queue action can be selected from the palette itself. Return focus to + // the previous app before sending Ctrl+V, then give GTK/Wayland time to publish + // the new clipboard contents to the compositor. + if self.window.is_visible() { + self.hide(); + } let mode = Config::load().paste_mode; match decide_paste(mode, menew_core::paste::uinput_writable()) { PasteAction::NotifyOnly => self.notify("menew-queue-next", &tr("queue_ready", lang, &[]), None), PasteAction::InjectCtrlV => { let this = Rc::clone(self); glib::spawn_future_local(async move { + glib::timeout_future(Duration::from_millis(menew_core::paste::FOCUS_DELAY_MS)).await; let result = gio::spawn_blocking(menew_core::paste::inject_ctrl_v).await; if !matches!(result, Ok(Ok(()))) { this.notify("menew-queue-next", &tr("queue_ready", lang, &[]), None); From bb4beb3da955a733528fa306cf91064152221d50 Mon Sep 17 00:00:00 2001 From: Codex Date: Tue, 1 Dec 2026 16:43:22 -0300 Subject: [PATCH 2/3] Wait for SQLite locks in GNOME image tests --- scripts/desktop-test/phase5.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/desktop-test/phase5.sh b/scripts/desktop-test/phase5.sh index 1dc3765..53c1671 100644 --- a/scripts/desktop-test/phase5.sh +++ b/scripts/desktop-test/phase5.sh @@ -2,7 +2,7 @@ # Phase 5 checks (images, files, filters, pause, smart actions, snippets, paste queue, OCR). # Sourced by gnome.sh and kde.sh after lib.sh. -db_sql() { sqlite3 "$MENEW_DB_PATH" "$1" 2>/dev/null; } +db_sql() { sqlite3 -cmd '.timeout 5000' "$MENEW_DB_PATH" "$1" 2>/dev/null; } images_dir() { echo "${MENEW_DB_PATH%.db}.images"; } count_kind() { db_sql "SELECT COUNT(*) FROM clipboard_entries WHERE kind='$1'"; } From 31728370432c3c8a54eafe3cd1deaca89f61e832 Mon Sep 17 00:00:00 2001 From: Codex Date: Tue, 1 Dec 2026 17:23:09 -0300 Subject: [PATCH 3/3] make GNOME paste queue clipboard check robust --- scripts/desktop-test/gnome.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/desktop-test/gnome.sh b/scripts/desktop-test/gnome.sh index 079676c..8782951 100755 --- a/scripts/desktop-test/gnome.sh +++ b/scripts/desktop-test/gnome.sh @@ -191,11 +191,13 @@ DE=gnome FIRST_TEXT="hello gnome" de_copy() { shell_copy_text "$1" >/dev/null; } de_clipboard_is() { - # St.Clipboard.get_text is asynchronous: store the result in a global, then read it back + # St.Clipboard.get_text is asynchronous: store the result in a global, then read it back. + # If Shell has not observed a compositor update yet, verify the selection through Wayland + # data-control as a second independent read path. shell_eval "globalThis.__menewClip = null; const St = imports.gi.St; St.Clipboard.get_default().get_text(St.ClipboardType.CLIPBOARD, (c, t) => { globalThis.__menewClip = t; }); 1" >/dev/null 2>&1 sleep 1 local out; out="$(shell_eval "globalThis.__menewClip" 2>/dev/null)" - [ "$out" = "(true, '\"$1\"')" ] || [ "$out" = "(true, '$1')" ] + [ "$out" = "(true, '\"$1\"')" ] || [ "$out" = "(true, '$1')" ] || clipboard_is "$1" } de_screenshot() { local res