const Atspi = imports.gi.Atspi;

function onChanged (event) {
    log(event.source.get_name() + ',' + event.source.get_role_name());
}

Atspi.init();
let atspiListener = Atspi.EventListener.new(onChanged);
atspiListener.register("object:state-changed:focused");
Atspi.event_main();
