summaryrefslogtreecommitdiff
path: root/cut-n-paste/toolbar-editor
diff options
context:
space:
mode:
Diffstat (limited to 'cut-n-paste/toolbar-editor')
-rw-r--r--cut-n-paste/toolbar-editor/egg-editable-toolbar.c12
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)
{