summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian.droege@collabora.co.uk>2009-11-25 08:16:05 +0100
committerSebastian Dröge <sebastian.droege@collabora.co.uk>2009-11-25 08:16:05 +0100
commitfee44493c5cb47910692299e6d499561e9792e9f (patch)
treeefda19f6064039579779ab73b7f6e1686103306e
parent579b8f3277800c7a4ddda8c9dedf3bcabf01c5ac (diff)
If GTK 2.18 is used, make sure that the DrawingArea has a native window attached
-rw-r--r--configure.ac4
-rw-r--r--samples/GtkVideoPlayer.cs10
2 files changed, 14 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 944c7b4..f95b139 100644
--- a/configure.ac
+++ b/configure.ac
@@ -125,6 +125,10 @@ AC_SUBST(GST_CFLAGS)
# glib-sharp and gtk-sharp and mono-cairo are currently only needed for the samples
PKG_CHECK_MODULES(GLIB_SHARP, glib-sharp-2.0 >= 2.12, have_glibsharp=yes, have_glibsharp=no)
PKG_CHECK_MODULES(GTK_SHARP, gtk-sharp-2.0 >= 2.12, have_gtksharp=yes, have_gtksharp=no)
+PKG_CHECK_MODULES(GTK_2_17_3, gtk+-2.0 >= 2.17.3, have_gtk_2_17_3=yes, have_gtk_2_17_3=no)
+if test "x$have_gtk_2_17_3" = "xyes"; then
+ GTK_SHARP_LIBS="$GTK_SHARP_LIBS -define:HAVE_GTK_2_17_3"
+fi
PKG_CHECK_MODULES(MONO_CAIRO, mono-cairo, have_monocairo=yes, have_monocairo=no)
AC_SUBST(GLIB_SHARP_LIBS)
AC_SUBST(GTK_SHARP_LIBS)
diff --git a/samples/GtkVideoPlayer.cs b/samples/GtkVideoPlayer.cs
index 391e413..dcc2ecc 100644
--- a/samples/GtkVideoPlayer.cs
+++ b/samples/GtkVideoPlayer.cs
@@ -23,6 +23,11 @@ public class MainWindow : Gtk.Window {
MainWindow window = new MainWindow ();
window.ShowAll ();
+#if HAVE_GTK_2_17_3
+ if (!gdk_window_ensure_native (window._da.GdkWindow.Handle)) {
+ Console.WriteLine ("Can't ensure a native window for the drawing area");
+ }
+#endif
switch (System.Environment.OSVersion.Platform) {
case PlatformID.Unix:
window._xWindowId = gdk_x11_drawable_get_xid (window._da.GdkWindow.Handle);
@@ -241,4 +246,9 @@ public class MainWindow : Gtk.Window {
[DllImport ("libgdk-win32-2.0-0.dll") ]
static extern IntPtr gdk_win32_drawable_get_handle (IntPtr handle);
+
+#if HAVE_GTK_2_17_3
+ [DllImport ("libgdk-win32-2.0-0.dll") ]
+ static extern bool gdk_window_ensure_native (IntPtr handle);
+#endif
}