#!/usr/bin/python3

import pyatspi
from gi.repository import GLib

def onStateChange(e):
    print(e.host_application, e.type, e.source)

def onWindow(e):
    e.source.clearCache()

pyatspi.Registry.registerEventListener(onStateChange, "object:state-changed:")
pyatspi.Registry.registerEventListener(onWindow, "window:")
pyatspi.Registry.start()
