From 9048aa7b89d9dd4d4e598167691ce48c15ae135d Mon Sep 17 00:00:00 2001 From: Stefano Karapetsas Date: Thu, 23 Jan 2014 00:18:26 +0100 Subject: toolbar-editor: Fix a crash when dropping an item to the toolbar https://git.gnome.org/browse/evince/commit/?h=gnome-3-4&id=c528881454c18ab29e300c3e3f2726409806eed3 --- cut-n-paste/toolbar-editor/egg-editable-toolbar.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'cut-n-paste/toolbar-editor') diff --git a/cut-n-paste/toolbar-editor/egg-editable-toolbar.c b/cut-n-paste/toolbar-editor/egg-editable-toolbar.c index e7c42b3e..bd66f6c6 100644 --- a/cut-n-paste/toolbar-editor/egg-editable-toolbar.c +++ b/cut-n-paste/toolbar-editor/egg-editable-toolbar.c @@ -599,8 +599,18 @@ action_sensitive_cb (GtkAction *action, GParamSpec *pspec, GtkToolItem *item) { - EggEditableToolbar *etoolbar = EGG_EDITABLE_TOOLBAR + EggEditableToolbar *etoolbar; + +#if GTK_CHECK_VERSION (3, 0, 0) + GtkWidget *ancestor = gtk_widget_get_ancestor (GTK_WIDGET (item), EGG_TYPE_EDITABLE_TOOLBAR); + if (!ancestor) + return; + + etoolbar = EGG_EDITABLE_TOOLBAR (ancestor); +#else + etoolbar = EGG_EDITABLE_TOOLBAR (gtk_widget_get_ancestor (GTK_WIDGET (item), EGG_TYPE_EDITABLE_TOOLBAR)); +#endif if (etoolbar->priv->edit_mode > 0) { -- cgit v1.2.1