diff --git a/crates/pdfs-gui/src/prompt.rs b/crates/pdfs-gui/src/prompt.rs index 39bb8b5..56850ee 100644 --- a/crates/pdfs-gui/src/prompt.rs +++ b/crates/pdfs-gui/src/prompt.rs @@ -515,12 +515,10 @@ fn build_window(app: &adw::Application) { ui_key.cycle_filter(back); glib::Propagation::Stop } - gtk4::gdk::Key::Return | gtk4::gdk::Key::KP_Enter => { - // Fall back to the top row when nothing is explicitly selected - // (e.g. results haven't rendered yet); `open` guards the rest. - ui_key.open(ui_key.cursor.get().unwrap_or(0), &window_key); - glib::Propagation::Stop - } + // Return is deliberately absent: `GtkText` binds it to `activate` + // and consumes it, so a bubble-phase controller on the window never + // sees it while the entry has focus (which is always, here). It is + // handled on the entry's `activate` signal instead — see below. _ => glib::Propagation::Proceed, } }); @@ -528,6 +526,22 @@ fn build_window(app: &adw::Application) { // pointer has moved focus into it. window.add_controller(keys); + // Enter opens the row under the cursor. This lives on the entry rather than + // with the other keys on the window because `GtkText` claims Return for its + // own `activate` binding, so a bubble-phase controller upstream of the + // focused entry is never reached. Enter with focus in the list is covered by + // `row_activated` above. + let ui_activate = ui.clone(); + let window_activate = window.clone(); + entry.connect_activate(move |_| { + if ui_activate.opening.get() { + return; + } + // Fall back to the top row when nothing is explicitly selected (e.g. + // results haven't rendered yet); `open` guards the rest. + ui_activate.open(ui_activate.cursor.get().unwrap_or(0), &window_activate); + }); + let debounce: Rc>> = Rc::new(RefCell::new(None)); let ui_changed = ui.clone(); entry.connect_changed(move |entry| { diff --git a/packaging/PKGBUILD b/packaging/PKGBUILD index 64f8695..ab0d5c7 100644 --- a/packaging/PKGBUILD +++ b/packaging/PKGBUILD @@ -9,7 +9,7 @@ # Build + install: cd packaging && makepkg -fi pkgname=proton-drive-linux -pkgver=0.5.0 +pkgver=0.6.1 pkgrel=1 pkgdesc="Proton Drive client for Linux: FUSE files-on-demand mount, CLI, GTK4 app + tray" arch=('x86_64')