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 recording not working because of bug in read window data #913

Merged
merged 1 commit into from
Nov 6, 2024

Conversation

KIRA009
Copy link
Contributor

@KIRA009 KIRA009 commented Nov 6, 2024

What kind of change does this PR introduce?
Fixes #904

Summary
This PR fixes the bug where recording was stuck in windows, because the app wasn't able to read the active window data.

Because of how pywinauto works, simply importing it causes it to set a value of the COM threading mode, that cannot be changed after that. When recording is started, the threading mode is set first, but then other threads try and change the mode, which causes the app to freeze, because changing modes is not allowed. This is also the reason you see the warning warnings.warn("Revert to STA COM threading mode", UserWarning)

Checklist

  • My code follows the style guidelines of OpenAdapt
  • I have performed a self-review of my code
  • If applicable, I have added tests to prove my fix is functional/effective
  • I have linted my code locally prior to submission
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation (e.g. README.md, requirements.txt)
  • New and existing unit tests pass locally with my changes

How can your code be run and tested?
Try and run the following on windows

 python -m openadapt.record "testing openadapt record"

@abrichr
Copy link
Member

abrichr commented Nov 6, 2024

@Animesh404 can you please test this on your machine?

@Animesh404
Copy link
Contributor

@Animesh404 can you please test this on your machine?

yup, it works 💯

Copy link
Member

@abrichr abrichr left a comment

Choose a reason for hiding this comment

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

LGTM! 🚀

@abrichr abrichr merged commit 4955237 into OpenAdaptAI:main Nov 6, 2024
1 check 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.

[Bug]: openadapt.record fails executing after getting stuck at Memory writer starting
3 participants