Skip to content

Fix toggle screen layout command in input gestures dialog - #19487

Merged
SaschaCowley merged 2 commits into
masterfrom
i18378
Jan 22, 2026
Merged

SaschaCowley merged 2 commits into
masterfrom
i18378

Conversation

@SaschaCowley

Copy link
Copy Markdown
Member

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:

  • 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

Code Review Checklist:

  • Documentation:
    • Change log entry
    • User Documentation
    • Developer / Technical Documentation
    • Context sensitive help for GUI changes
  • Testing:
    • Unit tests
    • System (end to end) tests
    • Manual testing
  • UX of all users considered:
    • Speech
    • Braille
    • Low Vision
    • Different web browsers
    • Localization in other languages / culture than English
  • API is compatible with existing add-ons.
  • Security precautions taken.

…terceptor needs to override script_toggleScreenLayout
@SaschaCowley
SaschaCowley marked this pull request as ready for review January 22, 2026 05:59
@SaschaCowley
SaschaCowley requested a review from a team as a code owner January 22, 2026 05:59
@SaschaCowley
SaschaCowley requested a review from seanbudd January 22, 2026 05:59
Comment thread source/browseMode.py Outdated
Comment thread source/virtualBuffers/__init__.py
@SaschaCowley
SaschaCowley enabled auto-merge (squash) January 22, 2026 07:01
@SaschaCowley
SaschaCowley merged commit 4689773 into master Jan 22, 2026
41 checks passed
@SaschaCowley
SaschaCowley deleted the i18378 branch January 22, 2026 07:32
@github-actions github-actions Bot added this to the 2026.2 milestone Jan 22, 2026
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

NVDA+V command has no keyboard shortcut in input gestures dialog

2 participants