#!/usr/bin/env python

import gtk
from gobject import new

# open a window
w = new(gtk.Window, title="Property notifier")
w.set_default_size(300, 300)
w.show_all()

# find our target
root = gtk.gdk.get_default_root_window()
target = gtk.gdk.window_foreign_new(long(root.property_get('_PROPERTY_LISTENER')[2][0]))

# send messages as fast as possible
n = 0

while gtk.main_iteration():
    target.property_change("_MESSAGE", "UTF8_STRING", 8, gtk.gdk.PROP_MODE_APPEND, str(n)+"\0")
    n = n + 1

