Skip to content

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

Closed

Description

@garyking

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

Activity

  1. bpasero commented on Nov 8, 2019

    @bpasero
    Contributor

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

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

  2. added
    info-needed
    on Nov 8, 2019
  3. added
    electron
    upstream
    on Nov 8, 2019
  4. OliverJAsh commented on Nov 8, 2019

    @OliverJAsh
    Contributor

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

  5. bpasero commented on Nov 8, 2019

    @bpasero
    Contributor
  6. OliverJAsh commented on Nov 8, 2019

    @OliverJAsh
    Contributor

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

    Screenshot 2019-11-08 at 15 19 19

  7. changed the title [-]Window titles appear as "(Untitled)"[/-] [+]In VSC 1.40, window titles appear as "(Untitled)" in accessibility apps[/+] on Nov 8, 2019
  8. antonblock commented on Nov 8, 2019

    @antonblock

    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
    
  9. ltd commented on Nov 8, 2019

    @ltd

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

  10. 25 remaining items

  11. removed this from the November 2019 milestone on Dec 9, 2019
  12. jryans commented on Dec 10, 2019

    @jryans

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

  13. bpasero commented on Dec 11, 2019

    @bpasero
    Contributor

    J. Ryan Stinnett (@jryans) thanks a lot ❤️

  14. yoadsn commented on Dec 12, 2019

    @yoadsn

    J. Ryan Stinnett (@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?

  15. jryans commented on Dec 12, 2019

    @jryans

    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.

  16. added a commit that references this issue on Dec 12, 2019
    a0ca9a6
  17. sergei-dyshel commented on Dec 12, 2019

    @sergei-dyshel

    Yoad Snapir (@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.

  18. rg-manytricks commented on Dec 13, 2019

    @rg-manytricks

    Yoad Snapir (@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.

  19. mjclemente commented on Dec 13, 2019

    @mjclemente
    Contributor

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

  20. added a commit that references this issue on Dec 14, 2019
    ce5b036
  21. ltd commented on Dec 17, 2019

    @ltd

    confirm, seeing titles in the latest insider build.

  22. ariofrio commented on Jan 9, 2020

    @ariofrio

    FWIW, this also affects conditional activation groups in BetterTouchTool.

  23. locked and limited conversation to collaborators on Jan 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

electronhelp wantedinfo-neededupstream

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions