-
-
Notifications
You must be signed in to change notification settings - Fork 355
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
Emacs windows not appearing in AltTab list #810
Comments
Hi @mjog! Could you please clarify which Emacs app you're running? It seems that mac ports are various, and exhibits issues. I see here for instance that there are flags specifically to get a version that has correct windows. |
I can't currently reproduce this either, may be intermittent? I restarted AltTab yesterday. |
Could you still please share with emacs app/port/version you are using? |
Sure thing, this one: https://vigou3.gitlab.io/emacs-modified-macos/ |
I think I can reproduce this:
Expected result: You can see the Emacs window in the list of windows you can switch to Observed result: You do not see the Emacs window, but instead only an icon which I think means something like "launch Emacs" (I think it tried to start a brand new Emacs when I made the mistake of selecting it once.) I am testing this on macOS 10.15.7, AltTab 6.17.0. (You can type ^X^C to exit Emacs.) I am guessing that some of the most important code for "non-native full screen" is here, looks like setting some kind of "full screen auxiliary window collection behavior". (Emacs users like me love this "non-native full screen" because you don't end up in a different Space™, you can have ordinary windows like terminals on top of Emacs's big window for code editing, etc.) Edited to add: AltTab seems to work fine with Emacs when Emacs is not in full screen mode, or when Emacs uses the normal ("native") macOS full screen mode. Thank you for AltTab. :) |
Maybe you're interested to see what Accessibility Inspector has to say about the non-native full screen Emacs window? (Pardon the green veil added by Accessibility Inspector, I've just got the one screen.) As you pointed out in the yabai issue you linked to above, the Emacs's windows seem to have role AXTextField This is true even when the Emacs window is not full screen. However, in non-native full screen, the normal Emacs window's subrole is AXUnknown. When that window is full screen, its subrole becomes AXStandardWindow, as you see above. |
@dsedivec thank you for the nice detailed information! I think it's the classic case of the window not being a real window ( In the meanwhile, I have been hardcoding app-specific exceptions, after users reported issues with these apps. The best of course, would be for the people behind emacs to use a window to do this non-native fullscreen window feature. Then it would simply work with AltTab. Have you opened a ticket with them? |
Do you mean to just have them set the role to AXWindow? The patch to do that seems very simple. I'm trying to compile Emacs with it now. If it works out, I'll propose it upstream and see what they say. If it works, I'm mostly mystified why they aren't already using it. My first guess would be that it somehow impairs accessibility, and to do something like properly enclose the text area in a normal window would be too invasive of a change. But I can ask. |
I just rebuilt Emacs HEAD with the patch for AXWindow and AltTab still doesn't list it, despite the role now showing AXWindow in Accessibility Inspector. Is there something else that could be causing AltTab to ignore Emacs? |
I see on your screenshot You can see the full logic to filter out windows from non-windows here. It's pretty simple. Given the simplicity of the patch you shared, you may be able to do the same change to if ([attribute isEqualToString: NSAccessibilitySubrole])
return NSAccessibilityStandardWindowSubrole; |
And indeed thirty seconds of testing indicates that works. I used this patch against Emacs's native-comp branch and now I can see "full screen" Emacs windows in AltTab. I should probably suggest this upstream, or find out why Emacs doesn't already do this. Thanks for your help! |
Cool! I'll close this ticket then. Feel free to report here if it gets fixed upstream 👍 |
Describe the bug
Emacs windows not appearing in AltTab list
Steps to reproduce the bug
The text was updated successfully, but these errors were encountered: