[gtk+/wip/baedert/children: 7/13] widget: Check for containerness before calling container API
- From: Timm Bäder <baedert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/wip/baedert/children: 7/13] widget: Check for containerness before calling container API
- Date: Fri, 18 Nov 2016 09:18:30 +0000 (UTC)
commit 32c7d33e671896602a475498c562942f2ee72706
Author: Timm Bäder <mail baedert org>
Date: Fri Nov 18 09:53:58 2016 +0100
widget: Check for containerness before calling container API
gtk/gtkwidget.c | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index d9b77bf..073f5d9 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -4024,8 +4024,11 @@ gtk_widget_unparent (GtkWidget *widget)
if (_gtk_widget_is_toplevel (toplevel))
_gtk_window_unset_focus_and_default (GTK_WINDOW (toplevel), widget);
- if (gtk_container_get_focus_child (GTK_CONTAINER (priv->parent)) == widget)
- gtk_container_set_focus_child (GTK_CONTAINER (priv->parent), NULL);
+ if (GTK_IS_CONTAINER (priv->parent))
+ {
+ if (gtk_container_get_focus_child (GTK_CONTAINER (priv->parent)) == widget)
+ gtk_container_set_focus_child (GTK_CONTAINER (priv->parent), NULL);
+ }
if (_gtk_widget_is_drawable (priv->parent))
gtk_widget_queue_draw_area (priv->parent,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]