rem: XLockDisplay (gtx->priv->display);
add: while (x_window_is_visible (gtx->priv->display, gtx->priv->toplevel) == FALSE) usleep(5000);
context: xine_thread (void *gtx_gen){	GtkXine *gtx = (GtkXine *) gtx_gen;	gtx->priv->init_finished = TRUE;	while (1) {		XEvent event;		XNextEvent (gtx->priv->display, &event);		switch (event.type) {		case Expose:			if (event.xexpose.count != 0)				break;			gtx->priv->vo_driver->gui_data_exchange				(gtx->priv->vo_driver,				 GUI_DATA_EX_EXPOSE_EVENT, &event);			break;		case FocusIn:			/* happens only in fullscreen mode */			XLockDisplay (gtx->priv->display);			XSetInputFocus (gtx->priv->display,					gtx->priv->toplevel, RevertToNone,					CurrentTime);			XUnlockDisplay (gtx->priv->display);			break;		}		if (event.type == gtx->priv->completion_event)		{			gtx->priv->vo_driver->gui_data_exchange				(gtx->priv->vo_driver,				 GUI_DATA_EX_COMPLETION_EVENT, &event);		}	}	pthread_exit (NULL);	return NULL;}