Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion activity.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,14 @@ def __init__(self, handle):
socket.add_id(windowid)
self.show_all()
socket.grab_focus()
GObject.child_watch_add(self.child_pid, lambda pid, cond: self.close())
def _child_exited_cb(self, pid, condition):
"""Handle child process termination"""
if os.WIFEXITED(condition):
exit_code = os.WEXITSTATUS(condition)
if exit_code != 0:
logging.warning('Pygame process exited with code: %d', exit_code)
self.close()
GObject.child_watch_add(self.child_pid, self._child_exited_cb)


def _main():
Expand Down