GNOME Bugzilla – Bug 350342
Alt+Left/Right reorders tabs if not swallowed by Gecko
Last modified: 2006-10-08 19:03:16 UTC
+++ This bug was initially created as a clone of Bug #344364 +++ epiphany 2.15.2 gtk+ 2.9.2 When I hit Alt+Left (back), if the page is already at the beginning of the tab history, the tab bar is reordered, the current tab moving to the left. The same happens with Alt+Right. This is surprising and (no doubt) non-higgy. -- The keybinding is interpreted by GtkAction in epiphany; since there's no history to go to it's insensitive and thus doesn't handle the keypress, which is then handled by GtkNotebook.interpreted by GtkNotebook. --- So this appears to be by design in gtk 2.9 gtknotebook: gtk_binding_entry_add_signal (binding_set, keysym, GDK_MOD1_MASK, "reorder_tab", 2, GTK_TYPE_DIRECTION_TYPE, direction, G_TYPE_BOOLEAN, move_to_last); gtk_binding_entry_add_signal (binding_set, keypad_keysym, GDK_MOD1_MASK, "reorder_tab", 2, GTK_TYPE_DIRECTION_TYPE, direction, G_TYPE_BOOLEAN, move_to_last); But I think this ought to use Ctrl-PgUp/Down instead. That would conflict with some textview bindings in gedit however... still, Alt-Left/Right is just wrong. Or the keybinding could just be left to the application.
I don't think Alt-Left/Right is wrong. But maybe we should only react to it if the focus is in the tab.
the focus-in-the-tab thing is hard to implement. so, I think we should consider changing the bindings, maybe to Shift-Alt-Left/Right. CC'ing the keybinding authority. A workaround for epiphany might be to make sure that Alt-Left/Right is always eaten by the content pane. One way to do that could be adding a dummy action that binds Alt-Left/Right to a NOP and whose sensitivity is the opposite of the sensitivity of the history actions.
Yowser. Y'know, there comes a time when I think you really can have too many widget-level keyboard shortcuts, but I'm sure Bill and Earl will disagree :) We really do need to do a better job of documenting the current state of things though; the Keyboard chapter in the a11y guide is great for users (although probably out of date by now), but not very handy as a reference for developers. So, I think there are a couple of things to consider here: - What are the shortcuts for re-ordering other things? On the panel, you transpose objects with Ctrl+Left/Right arrows, once you're in Move mode. For table column headers, we also proposed Ctrl+Left/Right arrows, but I can't find a suitable table right now to check if that was ever implemented (I think it was though.) - What related shortcuts apply to a GtkNotebook? Ctrl[+Alt]+PgUp/PgDn, for switching between tabs. (Alt is required when focus is in a text field, as text fields eat Ctrl+PgUp+PgDn.) Bearing in mind that we can't use Ctrl+Alt+arrows (the default 'switch workspace' keys) or Ctrl-Shift-arrows (used for selecting text), the next best options seem to be either: 1) Shift+Alt+left/right 2) Shift+Alt+PgUp/PgDn I don't *think* those are currenly used for anything else., but neither are stunningly consistent with anything listed above, either. We should probably also consider the related issues of bug #101659 and http://mail.gnome.org/archives/usability/2006-June/msg00026.html at the same time :/
Created attachment 74106 [details] [review] patch to implement what Matthias proposes in comment #1 The patch makes the notebook ignore the key binding unless the focus is in the tabs (the current tab label widget always get the focus in that case). This patch will improve the situation for ephy. However, to avoid key binding collision, the EphyNavigationAction code would have to check whether the notebook has the focus (and hence, one tab label widget) before moving through history. BTW, When I implemented the feature I used alt+left/right because that's what GtkTreeView uses for column reordering, so there's a bit of consistency there :)... It's ok to commit?
Thanks, committed. 2006-10-08 Matthias Clasen <mclasen@redhat.com> * gtk/gtknotebook.c (gtk_notebook_reorder_tab): Only reorder tabs if the focus is in the tab. (#350342, Carlos Garnacho Parro)