[gnome-games] Workaround for gdk_x11_window_get_xid not being in the vala bindings yet



commit 360b848ed40473d3ef320a06fc128939faa2e1b3
Author: Robert Ancell <robert ancell canonical com>
Date:   Thu Jan 13 15:46:45 2011 -0600

    Workaround for gdk_x11_window_get_xid not being in the vala bindings yet

 glchess/src/chess-view-3d.vala |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/glchess/src/chess-view-3d.vala b/glchess/src/chess-view-3d.vala
index 46ad16a..b2f0e91 100644
--- a/glchess/src/chess-view-3d.vala
+++ b/glchess/src/chess-view-3d.vala
@@ -2,6 +2,11 @@ using GL;
 using GLU;
 using GLX;
 
+// TEMP: This should be in the standard gdk-x11-3.0.vapi any day soon
+// https://bugzilla.gnome.org/show_bug.cgi?id=639467
+[CCode (cheader_filename = "gdk/gdkx.h")]
+private static extern X.ID gdk_x11_window_get_xid (Gdk.Window window);
+
 private class ChessView3D : ChessView
 {
     private GLX.Context context = (GLX.Context) null;
@@ -146,7 +151,7 @@ private class ChessView3D : ChessView
                        4, 5, 9, 8, 5,  5, 6, 10, 9, 6,  6, 7, 11, 10, 7,  7, 4, 8, 11, 8,
                        8, 9, 13, 12, 1,  9, 10, 14, 13, 2,  10, 11, 15, 14, 3,  11, 8, 12, 15, 4};
     }
-    
+
     private void realize_cb ()
     {
          int[] attributes = { GLX_RGBA,
@@ -159,7 +164,7 @@ private class ChessView3D : ChessView
                               GLX_ACCUM_GREEN_SIZE, 1,
                               GLX_ACCUM_BLUE_SIZE, 1,
                               0 }; /* NOTE: Should be None (from X11) but that is a pointer and Vala doesn't like that */
-        drawable = Gdk.x11_window_get_xid (get_window ());
+        drawable = gdk_x11_window_get_xid (get_window ());
         display = Gdk.x11_display_get_xdisplay (get_window ().get_display ());
         var screen = Gdk.x11_screen_get_screen_number (get_screen ());
         var visual = glXChooseVisual (display, screen, attributes);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]