diff -r a87c760e0dfa -r fcf0bc36025a gst-gmyth/playbinmaemo/gstplaybinmaemo.c --- a/gst-gmyth/playbinmaemo/gstplaybinmaemo.c Wed Aug 15 23:06:55 2007 +0100 +++ b/gst-gmyth/playbinmaemo/gstplaybinmaemo.c Fri Aug 17 19:28:10 2007 +0100 @@ -89,6 +89,8 @@ static gboolean add_element (GstPlayBinMaemo *pbm, GstElement *child); static void clear_elements (GstPlayBinMaemo *pbm); +static int x_error_handler (Display *display, + XErrorEvent *event); GST_BOILERPLATE(GstPlayBinMaemo, gst_play_bin_maemo, GstPipeline, GST_TYPE_PIPELINE) @@ -874,12 +876,12 @@ if ((pbm->video_sink != NULL) && (pbm->xid != -1) && (GST_IS_X_OVERLAY (pbm->video_sink))) { - Display *display; g_object_set (G_OBJECT (pbm->video_sink), "force-aspect-ratio", TRUE, NULL); display = XOpenDisplay(NULL); XMapRaised(display, pbm->xid); + XSetErrorHandler(x_error_handler); XSync (display, FALSE); gst_x_overlay_set_xwindow_id (GST_X_OVERLAY (pbm->video_sink), @@ -887,6 +889,28 @@ } } +static int +x_error_handler(Display *display, XErrorEvent *event) +{ + g_debug ("In x error handler:"); + + switch (event->error_code) { + case BadWindow: + g_debug ("got bad window"); + break; + case BadDrawable: + g_debug ("got bad drawable"); + break; + case BadGC: + g_debug ("got bad gc"); + break; + default: + g_debug ("unhandled x error = %d", event->error_code); + } + + return 0; +} + static gboolean add_element (GstPlayBinMaemo *pbm, GstElement *child)