diff options
author | Stefano Karapetsas <[email protected]> | 2014-01-23 00:18:26 +0100 |
---|---|---|
committer | Stefano Karapetsas <[email protected]> | 2014-01-23 00:18:26 +0100 |
commit | 9048aa7b89d9dd4d4e598167691ce48c15ae135d (patch) | |
tree | 150010bd34e69538517d686290fc7d99f86058cb /cut-n-paste | |
parent | ef8d5d040a91ddb30649d349d3226d4a1e2efcf0 (diff) | |
download | atril-9048aa7b89d9dd4d4e598167691ce48c15ae135d.tar.bz2 atril-9048aa7b89d9dd4d4e598167691ce48c15ae135d.tar.xz |
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
Diffstat (limited to 'cut-n-paste')
-rw-r--r-- | cut-n-paste/toolbar-editor/egg-editable-toolbar.c | 12 |
1 files changed, 11 insertions, 1 deletions
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) { |