Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UI Automation in Windows Console: Fix annoying focus repeating #10180

Closed
wants to merge 1 commit into from
Closed

UI Automation in Windows Console: Fix annoying focus repeating #10180

wants to merge 1 commit into from

Conversation

LeonarddeR
Copy link
Collaborator

Link to issue number:

None

Summary of the issue:

When starting an UIA console, speech output could go like this:

C:\WINDOWS\system32\cmd.exe  window
terminal
C:\Users\Leonard de Ruijter>
terminal
C:\Users\Leonard de Ruijter>
terminal
C:\Users\Leonard de Ruijter>

This is because the parent of the actual console window gets focus first and redirects its focus to the actual terminal. However, it looks like focus bounces back from parent to child around twice.

Description of how this pull request fixes the issue:

Don't let a consoleUIAWindow take focus if its focus redirect currently has focus. For this, we also cache the focus redirect.

Testing performed:

Tested that focus repeating does no longer occur.

Known issues with pull request:

None

Change log entry:

  • Bug fixes
    • In UIA in Windows consoles, focus announcements are no longer repeated unnecessarily.

@LeonarddeR
Copy link
Collaborator Author

Ugh, it looks like this somehow worked for me, but it turns out that I made a mistake in the code that caused shouldAllowUIAFocusEvent to fail. I didn't get any logging about this, though.

@LeonarddeR LeonarddeR closed this Sep 10, 2019
@LeonarddeR LeonarddeR deleted the fixWinConsoleFocus branch September 24, 2019 05:11
@mohdshara
Copy link

mohdshara commented Nov 8, 2019

I am confused here. did this ever get merged? this and #10030 isn't fixed as of today's build: alpha-19128,df0211c4

@LeonarddeR
Copy link
Collaborator Author

This wasn't merged at all, it was closed as the solution was invalid.

@mohdshara
Copy link

does this mean that #10030 should be re-opened? or should we file a new bug for this?

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.

2 participants