GTK+ < 3.8 compatibility, fixes #299