If you need to flush a display, use gdk_display_flush(). There is never a need to flush displays you don't know about.