changeset 26025:4859b0b82289

Hopefully stop the last of the BadWindow errors.
author Mike Ruprecht <maiku@soc.pidgin.im>
date Mon, 12 Jan 2009 02:01:05 +0000
parents ac4d7695dbc7
children 71eee5468b9d
files pidgin/gtkmedia.c
diffstat 1 files changed, 10 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/pidgin/gtkmedia.c	Mon Jan 12 01:09:20 2009 +0000
+++ b/pidgin/gtkmedia.c	Mon Jan 12 02:01:05 2009 +0000
@@ -350,10 +350,18 @@
 	return TRUE;
 }
 
+static gboolean
+realize_cb_cb(GstElement *element)
+{
+	gst_element_set_locked_state(element, FALSE);
+	gst_element_set_state(element, GST_STATE_PLAYING);
+	return FALSE;
+}
+
 static void
 realize_cb(GtkWidget *widget, GstElement *element)
 {
-	gst_element_set_state(element, GST_STATE_PLAYING);
+	g_timeout_add(0, (GSourceFunc)realize_cb_cb, element);
 }
 
 static void
@@ -408,6 +416,7 @@
 		} else if (type & PURPLE_MEDIA_VIDEO) {
 			if (!videosendbin && (type & PURPLE_MEDIA_SEND_VIDEO)) {
 				purple_media_video_init_src(&videosendbin);
+				gst_element_set_locked_state(videosendbin, TRUE);
 				purple_media_set_src(media, sessions->data, videosendbin);
 			}
 			if (!videorecvbool && (type & PURPLE_MEDIA_RECV_VIDEO)) {