summaryrefslogtreecommitdiff
path: root/gtk/gtkvideo.c
diff options
context:
space:
mode:
Diffstat (limited to 'gtk/gtkvideo.c')
-rw-r--r--gtk/gtkvideo.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/gtk/gtkvideo.c b/gtk/gtkvideo.c
index 15a5e25a36..f5b6f303e0 100644
--- a/gtk/gtkvideo.c
+++ b/gtk/gtkvideo.c
@@ -688,7 +688,13 @@ gtk_video_set_file (GtkVideo *self,
stream = gtk_media_file_new ();
if (gtk_widget_get_realized (GTK_WIDGET (self)))
- gtk_media_file_set_file (GTK_MEDIA_FILE (stream), file);
+ {
+ GdkSurface *surface;
+
+ surface = gtk_native_get_surface (gtk_widget_get_native (GTK_WIDGET (self)));
+ gtk_media_stream_realize (stream, surface);
+ gtk_media_file_set_file (GTK_MEDIA_FILE (stream), file);
+ }
gtk_video_set_media_stream (self, stream);
g_object_unref (stream);