From bc5d7efe972009efdc4cf2b3691d5ce36c0b5a49 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Fri, 19 Dec 2003 00:39:10 +0000 Subject: Fix the behaviour of insensitive actions, which was broken when Fri Dec 19 01:35:34 2003 Matthias Clasen Fix the behaviour of insensitive actions, which was broken when gtk_action_activate() was changed to pay attention to sensitivity (#129557, Christian Persch) * gtk/gtkaction.h: * gtk/gtkaction.c (_gtk_action_emit_activate): New auxiliary function to emit an activate signal without regard to sensitivity. * gtk/gtkradioaction.c: * gtk/gtktoggleaction.c: Always use _gtk_action_emit_activate() instead of gtk_action_activate(). --- gtk/gtkaction.c | 8 +++++++- gtk/gtkaction.h | 2 ++ gtk/gtkradioaction.c | 2 +- gtk/gtktoggleaction.c | 2 +- 4 files changed, 11 insertions(+), 3 deletions(-) (limited to 'gtk') diff --git a/gtk/gtkaction.c b/gtk/gtkaction.c index 7193312bf6..19730370f6 100644 --- a/gtk/gtkaction.c +++ b/gtk/gtkaction.c @@ -871,6 +871,12 @@ disconnect_proxy (GtkAction *action, g_signal_emit (action, action_signals[DISCONNECT_PROXY], 0, proxy); } +void +_gtk_action_emit_activate (GtkAction *action) +{ + g_signal_emit (action, action_signals[ACTIVATE], 0); +} + /** * gtk_action_activate: * @action: the action object @@ -889,7 +895,7 @@ gtk_action_activate (GtkAction *action) g_return_if_fail (GTK_IS_ACTION (action)); if (action->private_data->sensitive) - g_signal_emit (action, action_signals[ACTIVATE], 0); + _gtk_action_emit_activate (action); } /** diff --git a/gtk/gtkaction.h b/gtk/gtkaction.h index df0464e277..e855052d67 100644 --- a/gtk/gtkaction.h +++ b/gtk/gtkaction.h @@ -100,6 +100,7 @@ void gtk_action_block_activate_from (GtkAction *action, GtkWidget *proxy); void gtk_action_unblock_activate_from (GtkAction *action, GtkWidget *proxy); +void _gtk_action_emit_activate (GtkAction *action); /* protected ... for use by action groups */ void gtk_action_set_accel_path (GtkAction *action, @@ -107,6 +108,7 @@ void gtk_action_set_accel_path (GtkAction *action, void gtk_action_set_accel_group (GtkAction *action, GtkAccelGroup *accel_group); + G_END_DECLS #endif /* __GTK_ACTION_H__ */ diff --git a/gtk/gtkradioaction.c b/gtk/gtkradioaction.c index 38959da49e..e6ae027425 100644 --- a/gtk/gtkradioaction.c +++ b/gtk/gtkradioaction.c @@ -276,7 +276,7 @@ gtk_radio_action_activate (GtkAction *action) if (tmp_action->private_data->active && (tmp_action != toggle_action)) { - gtk_action_activate (GTK_ACTION (tmp_action)); + _gtk_action_emit_activate (GTK_ACTION (tmp_action)); break; } } diff --git a/gtk/gtktoggleaction.c b/gtk/gtktoggleaction.c index dd58e6199f..c3ac2d71f6 100644 --- a/gtk/gtktoggleaction.c +++ b/gtk/gtktoggleaction.c @@ -301,7 +301,7 @@ gtk_toggle_action_set_active (GtkToggleAction *action, if (action->private_data->active != is_active) { - gtk_action_activate (GTK_ACTION (action)); + _gtk_action_emit_activate (GTK_ACTION (action)); } } -- cgit v1.2.1