Fix a race in the video window X Bad Window

When listenning to the realized event, the first usage
of the GdkWindow in the sink happens before the window
is registered in the X server, resulting in a Bad Window segfault.
Set sort method from the correct place