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

VS Code auto save on window change doesn't work with AltTab on Mac #213062

Closed
QumiQumi opened this issue May 20, 2024 · 3 comments
Closed

VS Code auto save on window change doesn't work with AltTab on Mac #213062

QumiQumi opened this issue May 20, 2024 · 3 comments
Assignees
Labels
info-needed Issue requires more information from poster

Comments

@QumiQumi
Copy link

Does this issue occur when all extensions are disabled?: Yes

With a standard window change, autosave works correctly, but when using AltTab the file is not saved on Window change or on Focus change. I've created an issue in AltTab repo lwouis/alt-tab-macos#3367, but nothing they could do with this. Could you please check this out?
image
image

  • VS Code Version: 1.89.1
  • OS Version: macOS Sonoma 14.4.1
  • AltTab version: 6.69.0

Steps to Reproduce:

  1. Go to 'Preferences -> Files: Auto Save -> On Window Change'
  2. Add changes to any file
  3. Alt tab to other window and back
  4. File is still unsaved
@bpasero
Copy link
Member

bpasero commented May 20, 2024

So this does not reproduce when you disable Alt-Tab and use macOS built-in window switching?

@bpasero bpasero added the info-needed Issue requires more information from poster label May 20, 2024
@QumiQumi
Copy link
Author

Yes, with native window switching works just fine.
Pls, check last comments lwouis/alt-tab-macos#3367 in this issue. AltTab developer said nothing they could do with this problem and advised me to ask VS code developers..

@bpasero
Copy link
Member

bpasero commented May 21, 2024

We rely on this Electron event being fired: https://github.com/electron/electron/blob/main/docs/api/app.md#event-browser-window-focus to figure out that window focus changed.

The comment in lwouis/alt-tab-macos#1663 (comment) indicates that AltTab might be using a private API for focusing a window and probably we do not get the focus event from Electron then.

I suggest you change auto save to use onFocusChange.

I do not feel this is something VS Code can address, rather AltTab should fix.

@bpasero bpasero closed this as not planned Won't fix, can't repro, duplicate, stale May 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
info-needed Issue requires more information from poster
Projects
None yet
Development

No branches or pull requests

2 participants