Fullscreen toggle keybinding on about:keyboard only works for entering fullscreen, not exiting
Categories
(Firefox :: Keyboard Navigation, defect)
Tracking
()
People
(Reporter: voskresno, Unassigned)
Details
User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:159.0) Gecko/20100101 Firefox/159.0
Steps to reproduce
- Go to about:keyboard
- Scroll to View -> Full Screen
- Change keybinding from F11 to Ctrl+Shift+F
- Receive notification that this overwrites binding for 'Extensions and Themes'.
- Consent to overwriting.
- Press Ctrl+Shift+F to enter full screen (successful -- expected)
- Press Ctrl+Shift+F again to exit full screen (unsuccessful -- unexpected)
- Press F11 to exit full screen (successful -- unexpected)
- Press F11 to re-enter full screen (unsuccessful -- expected)
Actual results
The new keybinding only works for entering full screen.
The keybinding does not work for exiting full screen.
F11 (original keybinding) works for exiting full screen, but not for re-entering it.
Expected results
The new keybinding (Ctrl+Shift+F) should have worked for both entering and exiting full screen.
The original keybinding (F11) should not have worked for either entering or exiting full screen.
Comment 1•13 days ago
|
||
The Bugbug bot thinks this bug should belong to the 'Core::Widget: Gtk' component, but is not confident enough to move the bug to that component.
Comment 2•13 days ago
|
||
| frontend-triage | ||
Possible duplicate: bug 2067581
This belongs in Firefox :: Keyboard Navigation, which owns about:keyboard (CustomKeys.sys.mjs).
Cause: on Windows and Linux, fullscreen uses two <key> elements, both F11. They are key_enterFullScreen and a separate, reserved key_exitFullScreen (browser-sets.inc.xhtml). The second was added in bug 1821886 so that pages can't block leaving fullscreen. FullScreen._toggleShortcutKeys() (browser-fullScreenAndPointerLock.js) disables the enter key and enables the exit key while in fullscreen. about:keyboard only lists keys that menubar items reference (CustomKeysParent.sys.mjs). On Windows and Linux that is only key_enterFullScreen, so key_exitFullScreen is never customized and stays F11. On macOS, "Exit Full Screen" is already listed as its own row.
Suggested fix: in CustomKeys.sys.mjs, add a small non-mac map from a key to its companion: key_enterFullScreen → key_exitFullScreen. The map should be applied when the customization is applied, not stored in customKeys.json. Then:
changeKey/clearKey(throughapplyToKeyEl),resetKey/resetKeyEl,resetAllandapplyToNewWindowalso apply to the companion.- The MutationObserver's
applyToAddedKeymaps a companion id back to its primary id.
applyToKeyEl only touches data-l10n-id/key/keycode/modifiers, so the exit key keeps its reserved and disabled attributes. Changing a key's attributes rebuilds the keyset handlers (nsXULElement), so the new binding takes effect when the exit key is enabled again.
Tests: extend browser_CustomKeys.js with these checks:
- The companion follows change, clear, reset and resetAll.
- Ctrl+Shift+F enters and also exits fullscreen.
- F11 no longer exits.
For the fullscreen part, follow browser_fullscreen_keydown_reservation.js.
Suggested severity: S3. A customized fullscreen shortcut can't exit fullscreen on Windows and Linux, but the original F11 still works, and only users who remap the shortcut are affected.
If you'd like to provide feedback on this comment, please use the 👍 or 👎 reaction.
If you want to categorize your feedback you can add one of the following tags: ai-triage-{wrong-file, wrong-cause, hallucination, out-of-scope, not-a-bug, wrong-fix, shallow-fix, wrong-severity}.
Needinfo hackbot@mozilla.tld to have a patch generated for this bug, include any questions or directions as needed in your comment.
Updated•13 days ago
|
| Reporter | ||
Comment 3•9 days ago
|
||
(In reply to Hackbot [:hackbot] from comment #2)
Possible duplicate: bug 2067581
This seems to be correct; that bug appears to be identical. Apologies for the dupe; I did search before posting but did not find it.
Description
•