Hi, There is an even better (and simpler mechanism) to determine whether the user has interacted with an application: the _NET_WM_USER_TIME X11 property, which is maintained for each X11 top-level window and updated by X11 every time the user interacts with the application. Here is some initial untested code, which I would add to util.py or woodchuck.py: def last_user_interaction(): """Return the time at which the user last interacted with the application.""" def die(msg): if hasattr(die, 'once'): logging.debug(msg, exc_info=True) die.once = True # Use our current toolkit to return the value of _NET_WM_USER_TIME if gpodder.ui.gtk: try: from gtk.gdk import display_get_default return display_get_default().get_user_time() except Exception: die("Calling display_get_default().get_user_time()") # Fall through and use the generic routine. if gpodder.ui.qt: try: from PySide.QtGui import QX11Info return QX11Info.appUserTime() except Exception: die("Calling QX11Info.appUserTime()") # Fall through and use the generic routine. die("Unable to determine the time of the last user interaction, " "faking an active user.") # We don't have a way to determine the last interaction time. It # is better to incorrectly indicate that the user interacted with # the application than to incorrectly indicate that the user never # interacted with the application. return time.time() My idea would be to have Woodchuck record the time when it is initialized. Whenever an update is completed, Woodchuck checks the time. If the time is unchanged, then it causes gPodder to quit (how? Should it just do a sys.exit?). What do you think of this approach? Thanks, Neal