summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert McQueen <robert.mcqueen@collabora.co.uk>2006-10-10 14:48:07 +0000
committerRobert McQueen <robert.mcqueen@collabora.co.uk>2006-10-10 14:48:07 +0000
commit613f84a02e3efd271ff70c8cae5c2846874c9862 (patch)
tree4ad9414769ac5f6a2156912f5194fa82641c8068
parent84f2af360075df29b33703a1c78f45e1edd2eb08 (diff)
TpStreamEngine: ignore BadValue errors on preview/output windows (they can happen with xv)stream-engine_0.3.7
-rw-r--r--src/tp-stream-engine.c45
1 files changed, 45 insertions, 0 deletions
diff --git a/src/tp-stream-engine.c b/src/tp-stream-engine.c
index 64d5747..a89d6c9 100644
--- a/src/tp-stream-engine.c
+++ b/src/tp-stream-engine.c
@@ -130,6 +130,7 @@ struct _TpStreamEnginePrivate
TpStreamEngineXErrorHandler *handler;
guint bad_drawable_handler_id;
guint bad_gc_handler_id;
+ guint bad_value_handler_id;
guint bad_window_handler_id;
#ifdef MAEMO_OSSO_SUPPORT
@@ -264,6 +265,11 @@ bad_other_cb (TpStreamEngineXErrorHandler *handler,
gpointer data);
static gboolean
+bad_value_cb (TpStreamEngineXErrorHandler *handler,
+ guint window_id,
+ gpointer data);
+
+static gboolean
bad_window_cb (TpStreamEngineXErrorHandler *handler,
guint window_id,
gpointer data);
@@ -283,6 +289,9 @@ tp_stream_engine_init (TpStreamEngine *obj)
priv->bad_gc_handler_id =
g_signal_connect (priv->handler, "bad-gc", (GCallback) bad_other_cb,
obj);
+ priv->bad_value_handler_id =
+ g_signal_connect (priv->handler, "bad-value", (GCallback) bad_value_cb,
+ obj);
priv->bad_window_handler_id =
g_signal_connect (priv->handler, "bad-window", (GCallback) bad_window_cb,
obj);
@@ -421,6 +430,12 @@ tp_stream_engine_dispose (GObject *object)
priv->bad_gc_handler_id = 0;
}
+ if (priv->bad_value_handler_id)
+ {
+ g_signal_handler_disconnect (priv->handler, priv->bad_value_handler_id);
+ priv->bad_value_handler_id = 0;
+ }
+
if (priv->bad_window_handler_id)
{
g_signal_handler_disconnect (priv->handler, priv->bad_window_handler_id);
@@ -874,6 +889,36 @@ bad_other_cb (TpStreamEngineXErrorHandler *handler,
}
+static gboolean
+bad_value_cb (TpStreamEngineXErrorHandler *handler,
+ guint window_id,
+ gpointer data)
+{
+ TpStreamEngine *engine = data;
+ TpStreamEnginePrivate *priv = TP_STREAM_ENGINE_GET_PRIVATE (engine);
+ WindowPair *wp;
+
+ /* BEWARE: THIS CALLBACK IS NOT CALLED FROM THE MAINLOOP THREAD */
+
+ wp = _window_pairs_find_by_window_id (priv->preview_windows, window_id);
+
+ if (wp == NULL)
+ wp = _window_pairs_find_by_window_id (priv->output_windows, window_id);
+
+ if (wp == NULL)
+ {
+ g_debug ("%s: BadValue(%u) not for a preview or output window, not "
+ "handling", G_STRFUNC, window_id);
+ return FALSE;
+ }
+
+ g_debug ("%s: BadValue(%u) for a %s window being removed, ignoring",
+ G_STRFUNC, window_id, wp->stream == NULL ? "preview" : "output");
+
+ return TRUE;
+}
+
+
/**
* tp_stream_engine_remove_preview_window
*