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

Correctly move focus to child widget when opening a Qt window #14160

Open
CoBC opened this issue Sep 18, 2022 · 1 comment
Open

Correctly move focus to child widget when opening a Qt window #14160

CoBC opened this issue Sep 18, 2022 · 1 comment
Labels
blocked/needs-external-fix component/qt Qt fraphical framework needs-triage p3 https://github.com/nvaccess/nvda/blob/master/projectDocs/issues/triage.md#priority

Comments

@CoBC
Copy link
Sponsor

CoBC commented Sep 18, 2022

Steps to reproduce:

  1. Open a Qt window based on Qt 6.4 beta 3, 4 or RC (reproduceable with TeamTalk beta for example).

Actual behavior:

Speak

windows+m
Desktop  list
TeamTalk5  6 of 51
enter
TeamTalk v. 5.11.0.5094 - Unreleased  window
Channels list  Tree  Channels list Channels list
Channels list  Tree  Channels list Channels list
TeamTalk v. 5.11.0.5094 - Unreleased  window
f4
Preferences  dialog
General  tab
General  selected tab
General  selected tab
Preferences  dialog
right arrow
Display  tab
Display  selected tab
French
Do nothing
Join only
Alphabetical order
left arrow
General  selected tab
escape
TeamTalk v. 5.11.0.5094 - Unreleased  window
Channels list  Tree  Channels list Channels list
alt+f4

Explanation

As you can see, when you open a Qt window (here TeamTalk) NVDA read window title, focused widget, and window title again, on Braille display this cause window title to be announce instead of focused widget, and you not really know when you are. But, if you open a window (here preferences) and after you go back to previous window (here main window) focus is correctly move in appropriate order (channels list on my example) and all is correctly reported.

Expected behavior:

NVDA should move focus correctly following which is receive from Qt

NVDA logs, crash dumps and other attachments:

System configuration

NVDA installed/portable/running from source:

Installed

NVDA version:

Version: alpha-26572,26439b1c (2022.4.0.26572)

Windows version:

11.0.22621.521

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

All Qt based applications build with latest beta or RC of Qt6.4 (here TeamTalk beta)

Other information about your system:

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.

No

If NVDA 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?

Yes

Other info

FYI, this behavior has appeared after this change from Qt devs:
https://codereview.qt-project.org/c/qt/qtbase/+/416423/4/src/widgets/kernel/qwidget.cpp

@seanbudd seanbudd added component/qt Qt fraphical framework blocked/needs-technical-investigation Issue is blocked. A technical investigation is required to progress the issue. p3 https://github.com/nvaccess/nvda/blob/master/projectDocs/issues/triage.md#priority labels Sep 20, 2022
@michaelDCurran
Copy link
Member

michaelDCurran commented Oct 12, 2022

According to that change in QT:
When a window becomes active, QT deliberately refuses to fire a focus event on the widget with focus, as it assumes (incorrectly) that the AT already knows what the focused widget is.

When a window becomes active, I would expect the following:

  • a focus event fired on the window itself, and then
  • a focus event fired on the widget with focus.

This is very common practice in windows, and is what ATs would expect.

Some QT widgets, such as treeviews do seem to still sometimes fire a focus event when the window is activated, but this results in the focus events being out of order:

  • focus event for the treeview
  • Focus event for the window
    This is bad as the aT will first handle focus event for the widget, but then moves to the window, which is what the author of this issue is experiencing.

Note that I can reproduce this issue also with Narrator:
If I am in the Teamtalk Connect window, focused on the connect button, and I alt tab away and back again, both NvDA and Narrator only report the window and not the connect button.
Again, this is because QT is deliberately choosing not to fire the focus event on the button, which in my opinion is incorrect behaviour.

@michaelDCurran michaelDCurran added blocked/needs-external-fix and removed blocked/needs-technical-investigation Issue is blocked. A technical investigation is required to progress the issue. labels Oct 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked/needs-external-fix component/qt Qt fraphical framework needs-triage p3 https://github.com/nvaccess/nvda/blob/master/projectDocs/issues/triage.md#priority
Projects
None yet
Development

No branches or pull requests

3 participants