mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-23 17:14:23 +00:00
waylandsink: Workaround gnome-shell bug
Use a timeout to limit that amount of time we wait after the compositor for the initial configure event. Compositor are support to emit a configure event before any wl_buffer can be attached. The problem is that Weston strongly enforce this, while gnome-shell simply does not emit such an event.
This commit is contained in:
parent
112baf404e
commit
f14206f2b3
1 changed files with 10 additions and 2 deletions
|
@ -259,6 +259,8 @@ gst_wl_window_new_toplevel (GstWlDisplay * display, const GstVideoInfo * info,
|
||||||
|
|
||||||
/* Check which protocol we will use (in order of preference) */
|
/* Check which protocol we will use (in order of preference) */
|
||||||
if (display->xdg_wm_base) {
|
if (display->xdg_wm_base) {
|
||||||
|
gint64 timeout;
|
||||||
|
|
||||||
/* First create the XDG surface */
|
/* First create the XDG surface */
|
||||||
window->xdg_surface = xdg_wm_base_get_xdg_surface (display->xdg_wm_base,
|
window->xdg_surface = xdg_wm_base_get_xdg_surface (display->xdg_wm_base,
|
||||||
window->area_surface);
|
window->area_surface);
|
||||||
|
@ -286,8 +288,14 @@ gst_wl_window_new_toplevel (GstWlDisplay * display, const GstVideoInfo * info,
|
||||||
wl_display_flush (display->display);
|
wl_display_flush (display->display);
|
||||||
|
|
||||||
g_mutex_lock (&window->configure_mutex);
|
g_mutex_lock (&window->configure_mutex);
|
||||||
while (!window->configured)
|
timeout = g_get_monotonic_time () + 100 * G_TIME_SPAN_MILLISECOND;
|
||||||
g_cond_wait (&window->configure_cond, &window->configure_mutex);
|
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);
|
g_mutex_unlock (&window->configure_mutex);
|
||||||
} else if (display->wl_shell) {
|
} else if (display->wl_shell) {
|
||||||
/* go toplevel */
|
/* go toplevel */
|
||||||
|
|
Loading…
Reference in a new issue