Closed Bug 1389644 Opened 7 years ago Closed 7 years ago

GNOME is hardcoded to use "alt" for switching tabs instead of accel+1...9

Categories

(Firefox :: Tabbed Browser, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED WONTFIX

People

(Reporter: zbraniecki, Unassigned)

Details

Attachments

(1 file, 1 obsolete file)

At the moment Firefox enforces "alt" to be the modifier key for selecting tabs. Every other piece of UI follows "accel" which can be configured, but since bug 429219, this value is hardcoded for Gnome. See: http://searchfox.org/mozilla-central/rev/4b79f3b23aebb4080ea85e94351fd4046116a957/browser/base/content/browser-sets.inc#370 This breaks certain workflows and with the Keybinder extension (which allowed me to customize it) gone, I'd like to fix it.
Assignee: nobody → gandalf
Status: NEW → ASSIGNED
Non-blocking NI on :masauyki, since he's been the author of the early patch (10 years ago) so maybe he'll remember why he singled out Gnome and be able to confirm that we're ok to change that :)
Flags: needinfo?(masayuki)
Comment on attachment 8896458 [details] Bug 1389644 - Dehardcode selecting tab (accel+1...9) modifier key for Gnome. https://reviewboard.mozilla.org/r/167706/#review172928 Accel means Ctrl here, not Alt. So that's not what we want by default for Gnome.
Attachment #8896458 - Flags: review?(dao+bmo) → review-
> Accel means Ctrl here, not Alt. So that's not what we want by default for Gnome. What is the right modifier key then? chromeAccess is Alt on Windows and Unix, and Ctrl for Mac. accel is Ctrl on Windows and Unix, and Cmd for Mac. Would it then make sense to do #ifdef XP_GNOME #define NUM_SELECT_TAB_MODIFIER chromeAccess #else #define NUM_SELECT_TAB_MODIFIER accel #endif or can you recommend another way to solve it?
Flags: needinfo?(dao+bmo)
(p.s., it's a pseudo code, I realize that "chromeAccess" is not a proper modifier :) I just don't know how to get it into the .inc)
The reason was, Ctrl+[0-9] on Linux may cause inputting characters like French keyboard (according to the comments of bug 429219). So, you need to test it with French keyboard or something before landing the patch. # I wonder, changing existing such major shortcut key of Firefox may cause making users confused. If you claim they won't be confused, is the shortcut really necessary?
Flags: needinfo?(masayuki)
> The reason was, Ctrl+[0-9] on Linux may cause inputting characters like French keyboard (according to the comments of bug 429219). So, you need to test it with French keyboard or something before landing the patch. So, I was trying to read this bug and thought that the problem is specific to Windows (that's the UA of the reporter and OS of the bug), not Linux. On Linux, alt is the correct default key for selecting tabs (that's the same key the default Gnome Web Browser is using, so I assume it follows their HiG). The only thing I'd like to dehardcode it, and make it possible to follow the behavior on Mac (and Windows?) where the same modifier is used to open new tab (modifier+t), switch to the next tab (modifier+tab) and select a tab (modifier+1). I got used to this setup when I was on Mac and when I switched to Gnome I kept the same model. Now with the Keybinder extension gone, I got to the point where I have to write a patch to enable customization of the behavior :) If that requires some JS runtime logic to get the Preference and switch the modifier, I'm happy to write the code, I'd just like to understand what would be the right path to approach it :)
(In reply to Zibi Braniecki [:gandalf][:zibi] from comment #7) > > The reason was, Ctrl+[0-9] on Linux may cause inputting characters like French keyboard (according to the comments > > of bug 429219). So, you need to test it with French keyboard or something before landing the patch. > > So, I was trying to read this bug and thought that the problem is specific > to Windows (that's the UA of the reporter and OS of the bug), not Linux. I'm not sure about Windows, though. As far as I know, some South-Asian keyboard layout on Windows uses Ctrl+Shift+[0-9] as inputting character. > On Linux, alt is the correct default key for selecting tabs (that's the same > key the default Gnome Web Browser is using, so I assume it follows their > HiG). Sounds good. > The only thing I'd like to dehardcode it, and make it possible to follow the > behavior on Mac (and Windows?) where the same modifier is used to open new > tab (modifier+t), switch to the next tab (modifier+tab) and select a tab > (modifier+1). Hmm, on macOS, Alt key isn't available for shortcut keys because it works as AltGr on other platforms with *all* keyboard layouts. On the other hand, Ctrl key on macOS is also special. It's used as Emacs like shortcut key modifier. Even if Ctrl+[0-9] are not used on default macOS settings, they might be used by users who customize their OS level shortcut key. Now, we support OS level customized shortcut key on macOS since 55 or 56 (I don't remember the exact version). So, using Command key on macOS is reasonable... > I got used to this setup when I was on Mac and when I switched to Gnome I > kept the same model. Now with the Keybinder extension gone, I got to the > point where I have to write a patch to enable customization of the behavior > :) Hmm, ideally, we should have a global keybinding customizer which can modify <key> elements in chrome. WebExtensions cannot customize key combinations in chrome anymore. So, after 57, such function should be implemented by Firefox (toolkit?) itself. > If that requires some JS runtime logic to get the Preference and switch the > modifier, I'm happy to write the code, I'd just like to understand what > would be the right path to approach it :) If you want only to make the modifier for switching tabs customizable, I guess that you need to implement the keyboard event handling with JS, but it will cause the "key hell" issue. So, perhaps, it's impossible from a point of view of internationalization.
> Hmm, ideally, we should have a global keybinding customizer which can modify <key> elements in chrome. WebExtensions cannot customize key combinations in chrome anymore. So, after 57, such function should be implemented by Firefox (toolkit?) itself. :kmag, do you know is there's a plan to add ability to rebind UI keys via WebExtensions?
Flags: needinfo?(kmaglione+bmo)
Ok, there seem to be some API for that: bug 1325692, bug 1303384 and bug 1320332. I'll play with writing an extension for that.
Flags: needinfo?(kmaglione+bmo)
Flags: needinfo?(dao+bmo)
Attached file selectTab.zip
K'boom. I was able to create a web extension for the functionality I need. Sweet :)
Attachment #8896458 - Attachment is obsolete: true
Leaving it here in case anyone ever has the same problem and find it.
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → WONTFIX

I know a web extension fixes this issue but it really should be customizable in Firefox.

Flags: needinfo?(zbraniecki)

I am not involved in work in this area.

Assignee: zbraniecki → nobody
Flags: needinfo?(zbraniecki)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: