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

Ways to get z-index #20

Open
camhart opened this issue Jun 10, 2019 · 2 comments
Open

Ways to get z-index #20

camhart opened this issue Jun 10, 2019 · 2 comments

Comments

@camhart
Copy link

camhart commented Jun 10, 2019

Is there any way possible to get the z-index of each window? I can't find an attribute that seems to indicate z-index.

@tmandry
Copy link
Owner

tmandry commented Jun 13, 2019

Unfortunately, the only way I know of to do this involves a private API (specifically, _AXUIElementGetWindow to get the CGWindowID; then you can use CGWindowListCreate to get the windows in z-index order).

Hammerspoon does this (see code here and here).

I'm not sure I want to expose any private/unsupported APIs through AXSwift. If I do, it would be just a bare binding around _AXUIElementGetWindow with properly documented disclaimers around how this may stop working. Feel free to submit a PR if you want this. Higher level functionality on top of that wouldn't go in AXSwift (but perhaps it could go in Swindler).

@tmandry tmandry changed the title Question / Feature request Ways to get z-index Jun 13, 2019
@camhart
Copy link
Author

camhart commented Jun 13, 2019

Thanks for the response! I'll look into doing it myself. Feel free to close this unless you want to keep it around as a potential future feature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants