/* Check which protocol we will use (in order of preference) */
if (display->xdg_wm_base) {
+ gint64 timeout;
+
/* First create the XDG surface */
window->xdg_surface = xdg_wm_base_get_xdg_surface (display->xdg_wm_base,
window->area_surface);
wl_display_flush (display->display);
g_mutex_lock (&window->configure_mutex);
- while (!window->configured)
- g_cond_wait (&window->configure_cond, &window->configure_mutex);
+ timeout = g_get_monotonic_time () + 100 * G_TIME_SPAN_MILLISECOND;
+ while (!window->configured) {
+ if (!g_cond_wait_until (&window->configure_cond, &window->configure_mutex,
+ timeout)) {
+ GST_WARNING ("The compositor did not send configure event.");
+ break;
+ }
+ }
g_mutex_unlock (&window->configure_mutex);
} else if (display->wl_shell) {
/* go toplevel */