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

fix: get is_focused value dynamically #191

Merged

Conversation

ologbonowiwi
Copy link
Contributor

@ologbonowiwi ologbonowiwi commented Feb 12, 2025

closes #190

  • feat: write example to test against
  • feat: use activeApplication to get focused app

@ologbonowiwi
Copy link
Contributor Author

first execution is on this branch. second execution is on master version @nashaofu @louis030195

Xcap.Zsh.Feb.12.2025.mp4

@@ -76,7 +76,7 @@ impl Window {
}
/// The window is focused.
pub fn is_focused(&self) -> bool {
self.impl_window.is_focused
self.impl_window.is_focused()
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we don't get the value from a function, we get the focused app when the Window has been built. now we get if the value is focused at the time of checking instead of a static value

@ologbonowiwi ologbonowiwi changed the title fix: get Mac updated value for focused app fix: get is_focused value dynamically Feb 12, 2025
@louis030195
Copy link
Contributor

nice

@nashaofu nashaofu merged commit 214cb44 into nashaofu:master Feb 14, 2025
4 checks passed
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.

Find a way to check if window is focused for long-running apps
3 participants