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

refactor: use AXUIElement extension #242

Merged
merged 1 commit into from
Aug 5, 2024
Merged

Conversation

ShlomoCode
Copy link
Contributor

@ShlomoCode ShlomoCode commented Aug 5, 2024

Describe your changes

Use AXUIElement extension methods (based of https://github.com/lwouis/alt-tab-macos/blob/master/src/api-wrappers/AXUIElement.swift) for shorter and more readable code

The AXUIElement extension it's just a thin wrapper over the macOS AX APIs, which saves the call success check and dealing with the inout variable and types, etc.

Related issue number(s) and link(s)

Checklist before requesting a review

  • I have performed a self-review of my code
  • If this change affects core functionality, I have added a description highlighting the changes
  • I have followed conventional commit guidelines

Core Functionality Changes

There shouldn't be any functional change

@ShlomoCode ShlomoCode force-pushed the perf branch 4 times, most recently from 64679d9 to d7c8dc5 Compare August 5, 2024 22:59
@ShlomoCode
Copy link
Contributor Author

I'm not handling DockObserver.swift here as I'm going to rewrite the whole thing into the more efficient way from PR #214.

@ShlomoCode ShlomoCode marked this pull request as ready for review August 5, 2024 23:03
@ejbills
Copy link
Owner

ejbills commented Aug 5, 2024

Good to merge?

@ShlomoCode
Copy link
Contributor Author

@ejbills Yes it's ready to merge. Do you like the changes?

@ejbills
Copy link
Owner

ejbills commented Aug 5, 2024

@ejbills Yes it's ready to merge. Do you like the changes?

Yes! Reduces our repeated AXUIElement code blocks. Nice addition.

@ejbills ejbills merged commit b60d8b4 into ejbills:main Aug 5, 2024
1 check passed
@ShlomoCode ShlomoCode deleted the perf branch August 5, 2024 23:50
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

Successfully merging this pull request may close these issues.

2 participants