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

Closed windows are not removed from the tree on macOS 15 Sequoia #471

Closed
3 tasks done
FelixLisczyk opened this issue Aug 29, 2024 · 13 comments
Closed
3 tasks done

Closed windows are not removed from the tree on macOS 15 Sequoia #471

FelixLisczyk opened this issue Aug 29, 2024 · 13 comments
Labels
bug Something isn't working as expected

Comments

@FelixLisczyk
Copy link

FelixLisczyk commented Aug 29, 2024

I'm using Aerospace v0.14.2-Beta on the latest macOS 15 beta (24A5331b). When I close a window, it remains in the tree hierarchy and still takes up part of the screen. This issue does not occur on my macOS 14 installation.

Steps to Reproduce

  1. Go to an empty workspace
  2. Open Finder
  3. Open a second Finder window
  4. Close the second Finder window

Expected Result

The first Finder window should fill the entire display.

Actual Result

The first Finder window does not expand to fill the entire display.

Additional Notes

This issue also occurs with other applications.

Here is the output of aerospace list-windows --workspace visible after closing the second Finder window:

1034 | Finder | 
1028 | Finder | Desktop

Console output of aerospace debug-windows: debug-windows.txt

Checklist

aerospace CLI client version: 0.14.2-Beta 0cb8dbdfc5ee73b8cbc200f175f467ebead55201
AeroSpace.app server version: 0.14.2-Beta 0cb8dbdfc5ee73b8cbc200f175f467ebead55201
@FelixLisczyk FelixLisczyk changed the title Closed windows are not removed from tree on macOS 15 Sequoia Closed windows are not removed from the tree on macOS 15 Sequoia Aug 29, 2024
@nikitabobko nikitabobko added the bug Something isn't working as expected label Aug 29, 2024
@nikitabobko
Copy link
Owner

nikitabobko commented Sep 1, 2024

Can't reporduce in macos 15.1 Beta 3 (24B5035e). The problem is somewhere on your side

@FelixLisczyk
Copy link
Author

@nikitabobko Thank you for testing! I upgraded to macOS 15.1 beta 3 and reinstalled AeroSpace, but the issue continued. I then quit all running apps and background processes, and I found that the Contexts app was causing the problem. If anyone else has this issue, quit Contexts and restart AeroSpace to fix it.

@kennethkn
Copy link

kennethkn commented Sep 12, 2024

Same issue here. I'm on macOS 15.0 RC (24A335) & AeroSpace v0.14.2-Beta 0cb8dbdfc5ee73b8cbc200f175f467ebead55201. If you repeatedly close and open a finder window, it gets a smaller tile each time, which means windows that are closed aren't getting removed from the tree. I have no other active applications that could cause this. Would appreciate any help to troubleshoot.

@FelixLisczyk
Copy link
Author

My approach was to: (a) close all running applications, (b) close all menu bar apps, and (c) use Activity Monitor to end all background processes from third-party apps. Eventually, I identified the problem, which was Contexts in my case.

@kennethkn
Copy link

kennethkn commented Sep 12, 2024

Thanks Felix! I forgot to consider my menu bar apps. After debugging, it was Amazon Q that's causing the issue in my case. But it's worth noting that prior to the OS update, both apps were working in harmony. I noticed that is the case for your app as well. So what could be causing such a conflict? Because not using some app is more of a workaround than a fix. What our apps have in common is that they both install an overlay, which somehow interferes with how Aerospace detects active windows? Bottom line is I think this issue should remain open because Aerospace should work regardless of what app you have open.

@FelixLisczyk
Copy link
Author

To my knowledge, Aerospace utilizes Apple's accessibility API to detect and manage windows. Sequoia has implemented several changes to this API, which has caused problems for window managers like Amethyst. Unfortunately, I am not familiar enough with this API to identify the exact issue. It might be possible to reproduce the problem using a demo app in Xcode by comparing the list of windows reported by the accessibility API before and after closing a window. This could then be reported to the developers of the affected apps. The Contexts app hasn't been updated for several years, so I have now switched to an alternative.

@FelixLisczyk
Copy link
Author

The yabai window manager experienced the same issue when using Contexts or Amazon Q (Issue 2324, Issue 2431). A potential fix has been implemented (Commit). Perhaps this workaround could also be applied to AeroSpace, @nikitabobko?

@haveanicedavid
Copy link

Running into this issue as well - I use both Contexts and Amazon Q.

Binding a key to the 'close' command (ie alt-x = 'close') works as expected, but cmd+w leaves a phantom window:

CleanShot 2024-10-02 at 13 55 08

@avramukk
Copy link

avramukk commented Oct 4, 2024

the same issue for me(
CleanShot 2024-10-04 at 16 12 08@2x
Beta 15.1

UPD: fixed after closing amazon Q

@nikitabobko
Copy link
Owner

The yabai window manager experienced the same issue when using Contexts or Amazon Q (koekeishiya/yabai#2324 (comment), koekeishiya/yabai#2431 (comment)). A potential fix has been implemented (Commit). Perhaps this workaround could also be applied to AeroSpace, @nikitabobko?

yabai uses private APIs in their commit. I think that it's possible to circumvent this Sequoia bug using public APIs. My solution is described in #445

@jsonMartin
Copy link

To my knowledge, Aerospace utilizes Apple's accessibility API to detect and manage windows. Sequoia has implemented several changes to this API, which has caused problems for window managers like Amethyst. Unfortunately, I am not familiar enough with this API to identify the exact issue. It might be possible to reproduce the problem using a demo app in Xcode by comparing the list of windows reported by the accessibility API before and after closing a window. This could then be reported to the developers of the affected apps. The Contexts app hasn't been updated for several years, so I have now switched to an alternative.

Hey @FelixLisczyk , I also use currently use Contexts app for MacOS, but it's buggy with AeroSpace. What alternative have you switched to?

@FelixLisczyk
Copy link
Author

@jsonMartin I'm using AeroSpace and the Raycast window switcher to organize my windows. This issue is currently being worked on in #445, so it may work better with the Contexts app in the future.

@jsonMartin
Copy link

@jsonMartin I'm using AeroSpace and the Raycast window switcher to organize my windows. This issue is currently being worked on in #445, so it may work better with the Contexts app in the future.

Thanks! Funny you mention that, I also use Raycast and found the Switch Windows command. I migrated over from Contexts, and it works just about as well for application switching. Happy to remove one piece of redundant software from my stack; and it also works much better with AeroSpace.

I combined the above with AltTab for thumbnails and am happy with the result!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working as expected
Projects
None yet
Development

No branches or pull requests

6 participants