X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f6bcfd974ef26faf6f91a62cac09827e09463fd1..6ba636000f13b4bf7d3e7dcfad429713085f6700:/src/gtk1/colour.cpp

diff --git a/src/gtk1/colour.cpp b/src/gtk1/colour.cpp
index 1d004de25f..60e62c4b3a 100644
--- a/src/gtk1/colour.cpp
+++ b/src/gtk1/colour.cpp
@@ -15,6 +15,7 @@
 #include "wx/gdicmn.h"
 
 #include <gdk/gdk.h>
+#include <gdk/gdkx.h>
 #include <gdk/gdkprivate.h>
 
 //-----------------------------------------------------------------------------
@@ -180,9 +181,14 @@ void wxColour::CalcPixel( GdkColormap *cmap )
     
     M_COLDATA->FreeColour();
 
+#ifdef __WXGTK20__
+    if ((cmap->visual->type == GDK_VISUAL_GRAYSCALE) ||
+        (cmap->visual->type == GDK_VISUAL_PSEUDO_COLOR))
+#else
     GdkColormapPrivate *private_colormap = (GdkColormapPrivate*) cmap;
     if ((private_colormap->visual->type == GDK_VISUAL_GRAYSCALE) ||
         (private_colormap->visual->type == GDK_VISUAL_PSEUDO_COLOR))
+#endif
     {
         GdkColor *colors = cmap->colors;
         int max = 3 * (65536);