Fix toggle screen layout command in input gestures dialog - #19487
Merged
Merged
Conversation
…terceptor needs to override script_toggleScreenLayout
seanbudd
reviewed
Jan 22, 2026
seanbudd
approved these changes
Jan 22, 2026
SaschaCowley
enabled auto-merge (squash)
January 22, 2026 07:01
tareh7z
pushed a commit
to tareh7z/nvda
that referenced
this pull request
Feb 16, 2026
…9487) Fixes nvaccess#18378 ### Summary of the issue: The script to toggle screen layout in browse mode documents does not show the correct gestures: * If it is only bound to `NVDA+v` (the default), no gestures are shown. * If it is bound to multiple gestures, only a subset of these are shown. ### Description of user facing changes: The command shows all bound gestures in the input gestures dialog. ### Description of developer facing changes: Developers are now advised to implement the `_toggleScreenLayout` method on classes that inherit from `browseMode.BrowseModeDocumentTreeInterceptor`, rather than implementing `script_toggleScreenLayout`. The old approach will still work, it will just cause this issue to resurface for their document. ### Description of development approach: Refactored `browseMode.BrowseModeDocumentTreeInterceptor.script_toggleScreenLayout` to call a helper method, `_toggleScreenLayout`. If the helper method raises `NotImplementedError`, the unsupported message is presented to the user. The base implementation simply raises `NotImplementedError`. Changed `virtualBuffers.VirtualBuffer` to implement `_toggleScreenLayout` rather than `script_toggleScreenLayout`. ### Testing strategy: Ran from source. In Firefox, toggled Screen Layout and verified that the correct message was output and that it corresponded with the new screen layout state. In word, switched to browse mode and attempted to toggle screen layout, and observed that the unsupported message was heard. ### Known issues with pull request: None
5 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Link to issue number:
Fixes #18378
Summary of the issue:
The script to toggle screen layout in browse mode documents does not show the correct gestures:
NVDA+v(the default), no gestures are shown.Description of user facing changes:
The command shows all bound gestures in the input gestures dialog.
Description of developer facing changes:
Developers are now advised to implement the
_toggleScreenLayoutmethod on classes that inherit frombrowseMode.BrowseModeDocumentTreeInterceptor, rather than implementingscript_toggleScreenLayout. The old approach will still work, it will just cause this issue to resurface for their document.Description of development approach:
Refactored
browseMode.BrowseModeDocumentTreeInterceptor.script_toggleScreenLayoutto call a helper method,_toggleScreenLayout. If the helper method raisesNotImplementedError, the unsupported message is presented to the user. The base implementation simply raisesNotImplementedError.Changed
virtualBuffers.VirtualBufferto implement_toggleScreenLayoutrather thanscript_toggleScreenLayout.Testing strategy:
Ran from source. In Firefox, toggled Screen Layout and verified that the correct message was output and that it corresponded with the new screen layout state.
In word, switched to browse mode and attempted to toggle screen layout, and observed that the unsupported message was heard.
Known issues with pull request:
None
Code Review Checklist: