Skip to content

Commit c320083

Browse files
author
You name
committed
feat: use Tab key to switch between split panes
When split view is active (two panes visible), pressing Tab switches focus to the other pane. When split view is not active, Tab behaves normally (GTK default focus traversal). The handler runs before GTK's default key-press processing so that Tab is intercepted before it gets consumed by the focus chain. Inspired by: linuxmint#3648
1 parent 0ba73e5 commit c320083

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

src/nemo-window.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1233,6 +1233,18 @@ nemo_window_key_press_event (GtkWidget *widget,
12331233
}
12341234
}
12351235

1236+
/* Tab switches between split panes when both are visible */
1237+
if (event->keyval == GDK_KEY_Tab &&
1238+
(event->state & gtk_accelerator_get_default_mod_mask ()) == 0) {
1239+
NemoWindowPane *next_pane;
1240+
1241+
next_pane = nemo_window_get_next_pane (window);
1242+
if (next_pane != NULL) {
1243+
nemo_window_pane_grab_focus (next_pane);
1244+
return TRUE;
1245+
}
1246+
}
1247+
12361248
for (i = 0; i < G_N_ELEMENTS (extra_window_keybindings); i++) {
12371249
if (extra_window_keybindings[i].keyval == event->keyval) {
12381250
const GList *action_groups;

0 commit comments

Comments
 (0)