Skip to content

Commit

Permalink
Error handling for restore_window
Browse files Browse the repository at this point in the history
  • Loading branch information
LexiconCode committed Mar 10, 2021
1 parent 8f39c78 commit 6b3c50c
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion castervoice/lib/utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,14 @@ def minimize_window():
Window.get_foreground().minimize()

def restore_window():
'''
Restores last minimized window triggered minimize_window.
'''
global lasthandle
Window.restore(lasthandle)
if lasthandle is None:
printer.out("No previous window minimized by voice")
else:
Window.restore(lasthandle)

def get_active_window_info():
'''Returns foreground window executable_file, executable_path, title, handle, classname'''
Expand Down

0 comments on commit 6b3c50c

Please sign in to comment.