[gtk+/overlay: 19/34] overlay: check that the main widget is an ancestor of relative widget
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/overlay: 19/34] overlay: check that the main widget is an ancestor of relative widget
- Date: Sat, 11 Jun 2011 01:00:15 +0000 (UTC)
commit 113abf4970d07d70ceef2ad16df6534ff60ffaf4
Author: Ignacio Casal Quinteiro <icq gnome org>
Date: Fri May 27 00:12:21 2011 +0200
overlay: check that the main widget is an ancestor of relative widget
gtk/gtkoverlay.c | 17 +++++++++++++++--
1 files changed, 15 insertions(+), 2 deletions(-)
---
diff --git a/gtk/gtkoverlay.c b/gtk/gtkoverlay.c
index bc2bc91..819021e 100644
--- a/gtk/gtkoverlay.c
+++ b/gtk/gtkoverlay.c
@@ -164,8 +164,21 @@ gtk_overlay_set_property (GObject *object,
switch (prop_id)
{
case PROP_RELATIVE_WIDGET:
- priv->relative_widget = g_value_get_object (value);
- gtk_widget_queue_resize_no_redraw (GTK_WIDGET (overlay));
+ {
+ GtkWidget *relative_widget;
+
+ relative_widget = g_value_get_object (value);
+
+ if (priv->main_widget == NULL ||
+ (relative_widget != NULL &&
+ !gtk_widget_is_ancestor (priv->main_widget, relative_widget)))
+ {
+ g_warning ("relative_widget must be a child of the main widget");
+ break;
+ }
+ priv->relative_widget = relative_widget;
+ gtk_widget_queue_resize_no_redraw (GTK_WIDGET (overlay));
+ }
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]