vscode: In VSC 1.40, window titles are missing in accessibility apps

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 (86405ea23e3937316009fc27c9361deee66ffbf5, 2019-11-06T17:09:34.601Z) OS version: Darwin x64 18.7.0

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 21
  • Comments: 36 (15 by maintainers)

Commits related to this issue

Most upvoted comments

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

This appears to be a regression upstream with Electron. I have submitted https://github.com/electron/electron/pull/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).

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

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

Screenshot 2019-11-08 at 15 19 19

@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.

@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.

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.

Have same problem with Contexts.

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