glib2 windows: extract as a method