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

Please add windowNumber #97

Open
gerasimsergey opened this issue Jan 3, 2024 · 5 comments
Open

Please add windowNumber #97

gerasimsergey opened this issue Jan 3, 2024 · 5 comments

Comments

@gerasimsergey
Copy link

kCGWindowNumber

@tmandry
Copy link
Owner

tmandry commented Jan 4, 2024

See tmandry/x3#1 (comment). I'd accept a PR for a change that adds windowNumber as an optional property, because we cannot guarantee in a stable way that it will always be available. It would be fine to use the undocumented _AXUIElementGetWindow for this.

@gerasimsergey
Copy link
Author

@tmandry
Hello, thank you very much for your answer, I didn’t expect you to answer.
I really like Swindler and I'm trying to use this library in a small project.

But some things are missing, or rather there is no way to extend them, because many properties and methods are internal let delegate: WindowDelegate
If it were available then I could implement the methods I need...

If you use AXSwift then as I understand it there is AXUIElementRef almost everywhere
why not just make them readable in the Window and Application classes?

Then everyone could make the necessary extensions

For example, CGWindowID from AXUIElement or implement raize for a window

https://github.com/zenangst/AXEssibility/blob/main/Sources/AXEssibility/Classes/WindowAccessibilityElement.swift

@tmandry
Copy link
Owner

tmandry commented Jan 5, 2024

A public API could be added that returned the AXUIElement for a given Window/Application. I actually thought I'd added one already. It would again have to be optional, to support testing use cases where there isn't a real UIElement to return.

@gerasimsergey
Copy link
Author

I don’t quite understand, but if you implement this, I’m ready to actively test it on a real project

@gerasimsergey
Copy link
Author

Any update for this?

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