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

In VSC 1.40, window titles are missing in accessibility apps #84195

Closed
garyking opened this issue Nov 8, 2019 · 36 comments · Fixed by #86837
Closed

In VSC 1.40, window titles are missing in accessibility apps #84195

garyking opened this issue Nov 8, 2019 · 36 comments · Fixed by #86837
Assignees
Labels
electron Issues and items related to Electron help wanted Issues identified as good community contribution opportunities info-needed Issue requires more information from poster upstream Issue identified as 'upstream' component related (exists outside of VS Code)
Milestone

Comments

@garyking
Copy link

garyking commented Nov 8, 2019

Issue Type: Bug

I use a program called Witch, on my Mac, to navigate between windows. It is useful for jumping to a specific VS Code window. The window's title appears in Witch, which is usually the workspace for that window.

However, since upgrading to VS Code 1.40.0, all window titles only appear as "(Untitled)". Was there a change regarding this recently? Perhaps related to Electron? This issue seems to affect any Mac app that relies on OS accessibility features to access a window's title.

To reproduce this issue, you must be using VSC 1.40, and have at least two windows open in VSC. Their titles will then appear as "(Untitled)" in any of a number of Mac accessibility apps, including Witch. I already tested with all extensions disabled. I tested with latest Insiders as of 2019-11-08. The issue does not exist in VSC 1.39.2.

This setting must be enabled to cause this issue:

"window.newWindowDimensions": "maximized"

I'm on MacOS 10.14.6 (18G1012).

Screenshot:

Witch screenshot

VS Code version: Code 1.40.0 (86405ea, 2019-11-06T17:09:34.601Z)
OS version: Darwin x64 18.7.0

@bpasero
Copy link
Member

bpasero commented Nov 8, 2019

@deepak1556 we do give the window a title here:

title: product.nameLong,

I am not sure why "Untitled" would show up, but possibly a E6 regression in this case.

@garyking do you see the same with other electron app, e.g. try Electron Fiddle: https://electronjs.org/fiddle

@bpasero bpasero added the info-needed Issue requires more information from poster label Nov 8, 2019
@bpasero bpasero removed their assignment Nov 8, 2019
@bpasero bpasero added electron Issues and items related to Electron electron-6.0.x-update upstream Issue identified as 'upstream' component related (exists outside of VS Code) labels Nov 8, 2019
@OliverJAsh
Copy link
Contributor

Also seeing the same regression, except I'm using Contexts instead of Witch.

@bpasero
Copy link
Member

bpasero commented Nov 8, 2019

@OliverJAsh @garyking do you see the same when you run a different Electron application such as Electron Fiddle: https://electronjs.org/fiddle

@OliverJAsh
Copy link
Contributor

OliverJAsh commented Nov 8, 2019

The title seems to work with that ("Hello World 2!"):

Screenshot 2019-11-08 at 15 19 19

@garyking garyking changed the title Window titles appear as "(Untitled)" In VSC 1.40, window titles appear as "(Untitled)" in accessibility apps Nov 8, 2019
@antonblock
Copy link

Also seeing this with Contexts on MacOS 10.15.1. It began after upgrading to 1.40.0 yesterday.

image

Version: 1.40.0
Commit: 86405ea23e3937316009fc27c9361deee66ffbf5
Date: 2019-11-06T17:09:34.601Z
Electron: 6.1.2
Chrome: 76.0.3809.146
Node.js: 12.4.0
V8: 7.6.303.31-electron.0
OS: Darwin x64 19.0.0

@ltd
Copy link

ltd commented Nov 8, 2019

Also, seeing this with my hammerspoon scripts. began with 1.40.0

@garyking
Copy link
Author

garyking commented Nov 8, 2019

In the Mac Accessibility API, Witch retrieves the AXTitle property, which contains the window title. It seems like, in the case of VSC, the AXTitle property is blank. Other Electron apps, including Fiddle and Atom, have a proper AXTitle value for their windows.

I assume that screen readers used by the blind, etc. will also have trouble navigating VSC windows, because of this issue.

@cscalfani
Copy link

I'm seeing this in Witch too.

@vscodebot vscodebot bot removed the new release label Nov 11, 2019
@bpasero
Copy link
Member

bpasero commented Nov 11, 2019

We do set the title in VSCode in 2 places:

I am not sure if there is a third place where we have to call something. What I wonder: are maybe certain characters not allowed in this value for screen readers? Dos it reproduce if you configure window.title to a fixed value such as: "window.title": "vSCode"

@OliverJAsh
Copy link
Contributor

Dos it reproduce if you configure window.title to a fixed value such as: "window.title": "vSCode"

I just tried that with the title foo and I can still reproduce this bug.

@bpasero bpasero added the help wanted Issues identified as good community contribution opportunities label Nov 11, 2019
@bpasero
Copy link
Member

bpasero commented Nov 11, 2019

Adding "help wanted" if someone wants to chime in and has an idea.

@cscalfani
Copy link

Is AXTitle set anywhere? That's what Witch uses.

@bpasero
Copy link
Member

bpasero commented Nov 12, 2019

Well, if so it would need to be some API that we can use. I do not recall any explicit API in Electron that would set this but would assume the window title would just work.

@bpasero
Copy link
Member

bpasero commented Nov 12, 2019

Electron sources are here: https://github.com/atom/electron but they depend on all of Chromium too....

@jdecaron
Copy link

I had this bug with Contexts, my other applications were fine. I reverted to 1.39 and it's working again. I confirm that this bug was introduced by 1.40.

@garyking
Copy link
Author

If someone has time, please consider finding the VSCode commit that introduced this bug, using git bisect. I currently have Node 12 installed, and am unable to setup nvm, so I can't build a VSC version older than 1.40.

@bpasero
Copy link
Member

bpasero commented Nov 12, 2019

@garyking you should be able to by just changing our error in the build scripts, I think it would still work.

@garyking
Copy link
Author

garyking commented Nov 12, 2019

I removed the check for the installed Node version in build/npm/preinstall.js, but building 1.39.2 showed a lot of errors.

@bpasero
Copy link
Member

bpasero commented Nov 13, 2019

Can you share?

@garyking
Copy link
Author

I assume the issue is a combination of things with VSC and Electron, since the issue does not reproduce in other Electron apps.

@garyking garyking changed the title In VSC 1.40, window titles appear as "(Untitled)" in accessibility apps In VSC 1.40, window titles are missing in accessibility apps Nov 14, 2019
@cscalfani
Copy link

In the meantime, you can use ^W to switch windows inside of VSCode.

@bpasero bpasero added this to the November 2019 milestone Nov 18, 2019
@yoadsn
Copy link

yoadsn commented Nov 18, 2019

I use Contexts so suffer as well... BUT I used to use HyperSwitch - reinstalled and tested it - still shows the correct titles with VSC 1.4.
So, either Witch and Contexts should do whatever HyperSwitch does or someone has to nose dive into Electron V4-V6 diffs.. including Chromiums libs.. 😱

@nyrf
Copy link

nyrf commented Nov 28, 2019

Have same problem with Contexts.

@jryans
Copy link

jryans commented Dec 10, 2019

This appears to be a regression upstream with Electron. I have submitted electron/electron#21462 with a potential fix, so hopefully that can land, be backported, and then we can update VS Code with the fixed version.

To summarise the problem, Electron's AtomNSWindow implements accessibilityAttributeValue to provide various accessibility info to the OS, including window titles.

Chromium 75 changed to Apple's newer accessibility API for window titles in the super class that AtomNSWindow inherits from. macOS still supports both the old and new style APIs, but it will prefer the new style if it is implemented. This means the Electron window title is being ignored because the newer API at the Chromium level has taken precedence.

This is a regression that has been present since Electron 6.0.0 (the first release including the Chromium change above).

@bpasero
Copy link
Member

bpasero commented Dec 11, 2019

@jryans thanks a lot ❤️

@bpasero bpasero added this to the December/January 2020 milestone Dec 11, 2019
@yoadsn
Copy link

yoadsn commented Dec 12, 2019

@jryans Thank You! One thing I can't figure out is how one application (Hyper-Switch) is able to show the titles and another (Contexts and more..) cannot.
If it's OSX that ignores the titles - all external applications should not be able to access this information.
Any idea?

@jryans
Copy link

jryans commented Dec 12, 2019

Hard to be sure without reversing each app... but at least on my system, the window title was correct in window managers such as the built-in Mission Control view but empty via accessibility APIs. So, Contexts and other affected apps are presumably using accessibility, while HyperSwitch must be using some other data source perhaps like Mission Control does.

@sergei-dyshel
Copy link

@yoadsn
Accessibility API (NSAccessibilityTitleAttribute)isn't the only way to get window title. There is also CGWindowListCopyWindowInfo which does report correct title of vscode windows and may be probably used by HyperSwitch.

@rg-manytricks
Copy link

@yoadsn
Accessibility API (NSAccessibilityTitleAttribute)isn't the only way to get window title. There is also CGWindowListCopyWindowInfo which does report correct title of vscode windows and may be probably used by HyperSwitch.

The problem with that method is that it doesn't allow interactions with the window—closing, minimizing, etc. must be done via Accessibility. So for our app Witch, it's a non-solution, unfortunately.

-rob.

@mjclemente
Copy link
Contributor

@rg-manytricks Huge fan of your app - use it constantly - hoping the upstream fix resolves this. It's really frustrating.

deepak1556 pushed a commit that referenced this issue Dec 14, 2019
…apps (#86837)

* bump electron to 6.1.6, fixes #84195 missing window titles in accessibility apps

* update electron version string in cgmanifest.json
@ltd
Copy link

ltd commented Dec 17, 2019

confirm, seeing titles in the latest insider build.

@ariofrio
Copy link

ariofrio commented Jan 9, 2020

FWIW, this also affects conditional activation groups in BetterTouchTool.

@vscodebot vscodebot bot locked and limited conversation to collaborators Jan 28, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
electron Issues and items related to Electron help wanted Issues identified as good community contribution opportunities info-needed Issue requires more information from poster upstream Issue identified as 'upstream' component related (exists outside of VS Code)
Projects
None yet
Development

Successfully merging a pull request may close this issue.