Skip to content

Windows 11: a "pane" window gets focus when switching to certain apps, including Command Prompt #12648

@josephsl

Description

@josephsl

Hi,

Related: #12585

The following was reported on Twitter, and a discussion about this took place between I, @ctoth, and several users.

Steps to reproduce:

With Windows 11 preview installed:

  1. Open several apps.
  2. Run Command Prompt, Windows Terminal, or other application, preferably running Windows Subsystem for Linux (WSL) 2 shell active.
  3. Switch to a different app.
  4. Switch to Command Prompt.

Actual behavior:

Focus lands on "pane" window.

Expected behavior:

Focus lands on Command Prompt.

System configuration

NVDA installed/portable/running from source:

Installed

NVDA version:

2021.1, alpha-23336,9409b9dd

Windows version:

Windows 11 preview (build 22000.65)

Name and version of other software in use when reproducing the issue:

Command Prompt, Windows Terminal 1.9

Other information about your system:

A virtual machine running Insider Preview builds

Other questions

Does the issue still occur after restarting your computer?

Yes

Have you tried any other versions of NVDA? If so, please report their behaviors.

Older versions such as 2020.4 behave the same.

If add-ons are disabled, is your problem still occurring?

Yes

Does the issue still occur after you run the COM Registration Fixing Tool in NVDA's tools menu?

Not applicable

Additional context:

Currently a fix was deployed through Windows App Essentials, and @ctoth points out that it should be part of NVDA to begin with as this is a basic user experience issue.

Developer info for the pane object:

name: ''
role: ROLE_PANE
roleText: None
states: STATE_FOCUSED
isFocusable: False
hasFocus: True
Python object: <NVDAObjects.UIA.UIA object at 0x06EEB5B0>
Python class mro: (<class 'NVDAObjects.UIA.UIA'>, <class 'NVDAObjects.window.Window'>, <class 'NVDAObjects.NVDAObject'>, <class 'documentBase.TextContainerObject'>, <class 'baseObject.ScriptableObject'>, <class 'baseObject.AutoPropertyObject'>, <class 'garbageHandler.TrackedObject'>, <class 'object'>)
description: ''
location: RectLTWH(left=0, top=0, width=1600, height=1152)
value: None
appModule: <'explorer' (appName 'explorer', process ID 5928) at address 6d0e890>
appModule.productName: 'Microsoft® Windows® Operating System'
appModule.productVersion: '10.0.22000.51'
TextInfo: <class 'NVDAObjects.NVDAObjectTextInfo'>
windowHandle: 853144
windowClassName: 'Windows.UI.Input.InputSite.WindowClass'
windowControlID: 0
windowStyle: 1342177280
extendedWindowStyle: 0
windowThreadID: 6424
windowText: ''
displayText: ''
UIAElement: <POINTER(IUIAutomationElement) ptr=0x397a728 at 701c120>
UIA automationID:
UIA frameworkID: XAML
UIA runtimeID: (42, 853144)
UIA providerDescription: [pid:4556,providerId:0xD0498 Main:Nested [pid:5928,providerId:0xD0498 Main(parent link):Unidentified Provider (unmanaged:Windows.UI.Xaml.dll)]; Hwnd(parent link):Microsoft: HWND Proxy (unmanaged:UIAutomationCore.dll)]
UIA className: Windows.UI.Input.InputSite.WindowClass
UIA patterns available: LegacyIAccessiblePattern

Proposed solution:

Let NvDA ignore UIA focus event for this window, which then allows NVDA to notice that Command Prompt was focused. The ideal solution should come from Microsoft, and since Windows 11 is in preview, things can change, making the PR a bit risky (we need to revert changes if Microsoft fixes this).

Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions