Skip to content

Commit

Permalink
add pickle dumps state
Browse files Browse the repository at this point in the history
  • Loading branch information
jesicasusanto committed Jun 6, 2023
1 parent c36f13e commit 28b409f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions openadapt/window/_windows.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ def get_active_window_state() -> dict:
"data": data,
"window_id": meta["control_id"],
}
try:
pickle.dumps(state)
except Exception as exc:
logger.warning(f"{exc=}")
state.pop("data")
return state


Expand Down Expand Up @@ -80,6 +85,7 @@ def get_active_window() -> Desktop:
Desktop: The active window object.
"""
app = pywinauto.application.Application(backend="uia").connect(active_only=True)
logger.info(f"{app=}")
window = app.active()
logger.info(f"{window=}")
return window
Expand Down

0 comments on commit 28b409f

Please sign in to comment.