-
-
Notifications
You must be signed in to change notification settings - Fork 152
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: windows.get_active_window() #333
fix: windows.get_active_window() #333
Conversation
Result of bugfix : bugfix.331.-.Made.with.Clipchamp.mp4 |
openadapt/window/_windows.py
Outdated
except RuntimeError as e: | ||
logger.warning(e) | ||
return {} | ||
active_window = get_active_window() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please handle exception 🙏
openadapt/window/_windows.py
Outdated
@@ -28,7 +28,6 @@ def get_active_window_state() -> dict: | |||
try: | |||
active_window = get_active_window() | |||
except RuntimeError as e: | |||
logger.warning(e) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @jesicasusanto !
Can you please clarify why this was removed?
Seems you are using me but didn't get OPENAI_API_KEY seted in Variables/Secrets for this repo. you could follow readme for more information |
Seems you are using me but didn't get OPENAI_API_KEY seted in Variables/Secrets for this repo. you could follow readme for more information |
…returns-None-and-logs-error
Seems you are using me but didn't get OPENAI_API_KEY seted in Variables/Secrets for this repo. you could follow readme for more information |
1 similar comment
Seems you are using me but didn't get OPENAI_API_KEY seted in Variables/Secrets for this repo. you could follow readme for more information |
|
…rror' of https://github.com/jesicasusanto/PAT into fix---windows.get_active_window-returns-None-and-logs-error
Seems you are using me but didn't get OPENAI_API_KEY seted in Variables/Secrets for this repo. you could follow readme for more information |
Seems you are using me but didn't get OPENAI_API_KEY seted in Variables/Secrets for this repo. you could follow readme for more information |
openadapt/window/_windows.py
Outdated
""" | ||
_element_class = element.__class__ | ||
class TempElement(element.__class__): | ||
writable_props = pywinauto.base_wrapper.BaseWrapper.writable_props |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please fix indent
openadapt/window/_windows.py
Outdated
return properties | ||
|
||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove extra newline
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
addressed in 6685c36
Excellent, thank you @jesicasusanto !! 🙏 |
* return top_window of the active app * remove runtime exception * handle runtime error * handle COMerror * add logger.warning * add logger.warning * add get_properties * remove unnecessary imports * remove -> Desktop * monkey patching * fix get_properties * monkey patch __class__ * fix monkey patching * format with black
What kind of change does this PR introduce?
This PR changes the _windows.get_active_window_state() in https://github.com/OpenAdaptAI/OpenAdapt/blob/main/openadapt/window/_windows.py#L31 , to get the top window of the active application. This PR resolves getting the "No windows of that application are active" logger wawrning.
Summary
This PR is a bugfix for #331.
Checklist
How can your code be run and tested?
Create a new recording on windows, switch to a different application. You should not see the "No windows of that application are active" warning again.