Skip to content

Correct focus in Objects Explorer (vs2017 and up)#9415

Merged
feerrenrut merged 14 commits into
nvaccess:masterfrom
francipvb:i9311
May 6, 2019
Merged

Correct focus in Objects Explorer (vs2017 and up)#9415
feerrenrut merged 14 commits into
nvaccess:masterfrom
francipvb:i9311

Conversation

@francipvb

@francipvb francipvb commented Mar 28, 2019

Copy link
Copy Markdown
Contributor

Link to issue number:

Closes #9311

Summary of the issue:

In visual studio 2017 (version 15.3 and up), the object explorer window is not working properly due to an incorrect MSAA implementation.
See #9313 for a previous approach to solve this.

Description of how this pull request fixes the issue:

This adds an overlay class for the tree view items in object explorer. It takes a focusRedirect event and checks for its states
If STATE_FOCUSED is not in the states set, it redirects the event to the real focused object.
I'm not really sure if it is the right way of doing this.

Testing performed:

Tested against visual studio 15.9 and up to 16.0.rc4.

Known issues with pull request:

State changes are not reported for secondary items, so expand and contract events are not reported by NVDA. I don't have more information.

Change log entry:

Section: Bug fixes

@francipvb

Copy link
Copy Markdown
Contributor Author

cc @LeonarddeR

@codeofdusk

Copy link
Copy Markdown
Contributor

Could you maybe use the focus redirection system instead of getting event_gainFocus?

@lukaszgo1

Copy link
Copy Markdown
Contributor

@francipvb You're importing ui in the appModule hovewer it isn't used anywhere - probably left when debugging.

@francipvb

Copy link
Copy Markdown
Contributor Author

Hello,

Could you maybe use the focus redirection system instead of getting event_gainFocus?

Thanks, done. It is a more clean approach 👍

@francipvb You're importing ui in the appModule hovewer it isn't used anywhere - probably left when debugging.

Fixed too, thanks. 👍

Cheers,

@LeonarddeR

Copy link
Copy Markdown
Collaborator

@DanteGagne: Do you think there could be a possibility to fix this in Visual Studio itself?

@LeonarddeR LeonarddeR left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just some small things

Comment thread source/appModules/devenv.py Outdated

class AppModule(appModuleHandler.AppModule):
def chooseNVDAObjectOverlayClasses(self, obj, clsList):
vs_major, vs_minor, rest = self.productVersion.split(".", 2)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
vs_major, vs_minor, rest = self.productVersion.split(".", 2)
vsMajor, vsMinor = map(int, self.productVersion.split(".", 2)[:2])

You can also remove the lina below. Note the change from vs_major to vsMajor, vs_minor to vsMinor, which is more like the general code style of NVDA.

@LeonarddeR LeonarddeR left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is ok from a code perspective. I need to have a look with Visual Studio, probably next week.
In the meanwhile, could you please update the initial description of the pr to reflect the current implementation (i.e. with focusRedirect instead of patching event_gainFocus)?

@feerrenrut feerrenrut left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@LeonarddeR I'm going to merge this in, would you mind reporting back here if there are any issues with the focus in the object explorer window.

@feerrenrut feerrenrut merged commit 2239a76 into nvaccess:master May 6, 2019
@nvaccessAuto nvaccessAuto added this to the 2019.2 milestone May 6, 2019
feerrenrut added a commit that referenced this pull request May 6, 2019
feerrenrut pushed a commit that referenced this pull request May 13, 2019
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.

Object explorer not working correctly in Visual Studio 2017 (v15.3 and up)

6 participants