[gtk+/overlay] Fix the build, and fix the ancestor check



commit f43f712114d9a1320542ca8d2d54162697d71a3b
Author: Matthias Clasen <mclasen redhat com>
Date:   Fri Jun 10 22:04:22 2011 -0400

    Fix the build, and fix the ancestor check

 gtk/gtkoverlay.c |   16 ++++++++++------
 1 files changed, 10 insertions(+), 6 deletions(-)
---
diff --git a/gtk/gtkoverlay.c b/gtk/gtkoverlay.c
index 6d30c5d..3f39026 100644
--- a/gtk/gtkoverlay.c
+++ b/gtk/gtkoverlay.c
@@ -23,6 +23,7 @@
 #include "config.h"
 
 #include "gtkoverlay.h"
+#include "gtkbuildable.h"
 
 #include "gtkprivate.h"
 #include "gtkintl.h"
@@ -59,8 +60,9 @@ enum
 
 G_DEFINE_TYPE (GtkOverlay, gtk_overlay, GTK_TYPE_CONTAINER)
 
-/* the reason for this is that the main widget doesn't need to set an offset
-   and it doesn't need an extra window */
+/* the reason for this is that the main widget doesn't need
+ * to set an offset and it doesn't need an extra window
+ */
 static void
 add_child (GtkOverlay *overlay,
            GtkWidget  *widget)
@@ -169,9 +171,9 @@ gtk_overlay_set_property (GObject      *object,
 
         relative_widget = g_value_get_object (value);
 
-        if (priv->main_widget == NULL ||
-            (relative_widget != NULL &&
-             !gtk_widget_is_ancestor (priv->main_widget, relative_widget)))
+        if (priv->main_widget != NULL &&
+            relative_widget != NULL &&
+            !gtk_widget_is_ancestor (relative_widget, priv->main_widget))
           {
             g_warning ("relative_widget must be a child of the main widget");
             break;
@@ -568,7 +570,9 @@ gtk_overlay_forall (GtkContainer *overlay,
 static GType
 gtk_overlay_child_type (GtkContainer *overlay)
 {
-  if (overlay->priv->main_widget != NULL)
+  GtkOverlayPrivate *priv = GTK_OVERLAY (overlay)->priv;
+
+  if (priv->main_widget != NULL)
     return G_TYPE_NONE;
   else
     return GTK_TYPE_WIDGET;



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