#!/usr/bin/python3

import pyatspi

def onShowing(e):
    try:
        appName = e.host_application.name
    except:
        return

    if appName in ["gtk-demo", "gtk3-demo"]:
        print(e)

pyatspi.Registry.registerEventListener(onShowing, "object:state-changed:showing")
pyatspi.Registry.start()
