diff --git a/subprojects/gst-plugins-bad/ext/gtk/gstgtkwaylandsink.c b/subprojects/gst-plugins-bad/ext/gtk/gstgtkwaylandsink.c index 144db559e2..d5e481f47b 100644 --- a/subprojects/gst-plugins-bad/ext/gtk/gstgtkwaylandsink.c +++ b/subprojects/gst-plugins-bad/ext/gtk/gstgtkwaylandsink.c @@ -461,6 +461,17 @@ scrollable_window_adjustment_changed_cb (GtkAdjustment * adjustment, return FALSE; } +static void +wl_window_map_cb (GstWlWindow * wl_window, GstGtkWaylandSink * self) +{ + GstGtkWaylandSinkPrivate *priv = + gst_gtk_wayland_sink_get_instance_private (self); + + GST_DEBUG_OBJECT (self, "waylandsink surface is ready"); + + gtk_gst_base_widget_queue_draw (GTK_GST_BASE_WIDGET (priv->gtk_widget)); +} + static void setup_wl_window (GstGtkWaylandSink * self) { @@ -487,6 +498,8 @@ setup_wl_window (GstGtkWaylandSink * self) wl_surface, &priv->render_lock); gst_wl_window_set_rotate_method (priv->wl_window, priv->current_rotate_method); + g_signal_connect_object (priv->wl_window, "map", + G_CALLBACK (wl_window_map_cb), self, 0); } /* In order to position the subsurface correctly within a scrollable widget, diff --git a/subprojects/gst-plugins-bad/gst-libs/gst/wayland/gstwlwindow.c b/subprojects/gst-plugins-bad/gst-libs/gst/wayland/gstwlwindow.c index 68faed88be..afdbc10816 100644 --- a/subprojects/gst-plugins-bad/gst-libs/gst/wayland/gstwlwindow.c +++ b/subprojects/gst-plugins-bad/gst-libs/gst/wayland/gstwlwindow.c @@ -79,6 +79,7 @@ G_DEFINE_TYPE_WITH_CODE (GstWlWindow, gst_wl_window, G_TYPE_OBJECT, enum { CLOSED, + MAP, LAST_SIGNAL }; @@ -155,6 +156,9 @@ gst_wl_window_class_init (GstWlWindowClass * klass) signals[CLOSED] = g_signal_new ("closed", G_TYPE_FROM_CLASS (gobject_class), G_SIGNAL_RUN_LAST, 0, NULL, NULL, NULL, G_TYPE_NONE, 0); + signals[MAP] = g_signal_new ("map", G_TYPE_FROM_CLASS (gobject_class), + G_SIGNAL_RUN_LAST, 0, NULL, NULL, NULL, G_TYPE_NONE, 0); + } static void @@ -509,6 +513,7 @@ gst_wl_window_render (GstWlWindow * self, GstWlBuffer * buffer, gst_wl_window_update_borders (self); wl_surface_commit (priv->area_surface_wrapper); priv->is_area_surface_mapped = TRUE; + g_signal_emit (self, signals[MAP], 0); } } else { /* clear both video and parent surfaces */