Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions linux/changelog.d/3883.added.1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Ctrl+Shift+O opens the overview of the window's tabs, where typing searches them.
1 change: 1 addition & 0 deletions linux/changelog.d/3883.added.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Ctrl+E goes back to the tab shown before; hold Ctrl and press E again to go further back.
4 changes: 4 additions & 0 deletions linux/crates/app/src/application/accelerators.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,10 @@ pub const ACCELERATORS: &[Accelerator] = &[
application("win.new-editor-tab", &["<Primary>t"], Tabs),
application("win.close-current", &["<Primary>w"], Tabs),
application("win.reopen-closed-tab", &["<Primary><Shift>t"], Tabs),
// Ctrl+Tab stays the tab view's next tab, as across GNOME.
application("win.switch-recent-tab", &["<Primary>e"], Tabs),
// As in GNOME Web and Console.
application("win.show-tabs", &["<Primary><Shift>o"], Tabs),
// AdwTabView's own controller, which runs in the capture phase. The
// workspace removes its Ctrl+Home and Ctrl+End pairs, so the lists
// and the editor inside the tabs keep those keys.
Expand Down
30 changes: 30 additions & 0 deletions linux/crates/app/src/test_support/key_injector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,23 @@ impl KeyInjector {
Ok(())
}

/// Keep `keyval` down until the guard drops, so a failed test does
/// not leave it held for the next one.
pub(crate) fn hold(&self, keyval: gdk::Key) -> Result<Held<'_>, KeyInjectionError> {
let keycode = self.keycode(keyval)?;
self.fake(KEY_PRESS_EVENT, keycode)?;
self.connection.flush()?;
self.connection.get_input_focus()?.reply()?;
Ok(Held { keys: self, keycode })
}

fn let_go(&self, keycode: u8) -> Result<(), KeyInjectionError> {
self.fake(KEY_RELEASE_EVENT, keycode)?;
self.connection.flush()?;
self.connection.get_input_focus()?.reply()?;
Ok(())
}

/// Click the primary button `count` times at `at` in `widget`'s own
/// coordinates, in the window that has the keyboard. A widget not laid
/// out yet sits at the window's corner, so it is refused.
Expand Down Expand Up @@ -141,6 +158,19 @@ impl KeyInjector {
}
}

pub(crate) struct Held<'a> {
keys: &'a KeyInjector,
keycode: u8,
}

impl Drop for Held<'_> {
fn drop(&mut self) {
if let Err(error) = self.keys.let_go(self.keycode) {
tracing::error!(%error, "a held key was not let go");
}
}
}

fn require_x11(display_type: &str) -> Result<(), KeyInjectionError> {
if display_type == X11_DISPLAY {
Ok(())
Expand Down
1 change: 1 addition & 0 deletions linux/crates/app/src/ui/workspace/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ mod health_banner;
mod imp;
mod import;
mod import_ledger;
mod recent_tabs;
mod references;
mod saves;
mod session_watches;
Expand Down
Loading
Loading