examples: use Gtk+-2.18 API conditionally

so the seek example and colorkey test work with older Gtk+ versions
as well.

Fixes #605960.
This commit is contained in:
Tim-Philipp Müller 2010-01-04 09:49:25 +00:00
parent 7388401f93
commit fe970cb856
2 changed files with 4 additions and 0 deletions

View file

@ -2438,10 +2438,12 @@ handle_expose_cb (GtkWidget * widget, GdkEventExpose * event, gpointer data)
static void
realize_cb (GtkWidget * widget, gpointer data)
{
#if GTK_CHECK_VERSION(2,18,0)
/* This is here just for pedagogical purposes, GDK_WINDOW_XID will call it
* as well */
if (!gdk_window_ensure_native (widget->window))
g_error ("Couldn't create native window needed for GstXOverlay!");
#endif
#ifdef HAVE_X
embed_xid = GDK_WINDOW_XID (video_window->window);

View file

@ -81,10 +81,12 @@ handle_expose_cb (GtkWidget * widget, GdkEventExpose * event, gpointer data)
static void
realize_cb (GtkWidget * widget, gpointer data)
{
#if GTK_CHECK_VERSION(2,18,0)
/* This is here just for pedagogical purposes, GDK_WINDOW_XID will call it
* as well */
if (!gdk_window_ensure_native (widget->window))
g_error ("Couldn't create native window needed for GstXOverlay!");
#endif
embed_xid = GDK_WINDOW_XID (video_window->window);
g_print ("Window realize: got XID %lu\n", embed_xid);