Commit 3f787738 authored by Mike Gorse's avatar Mike Gorse Committed by Li Yuan

Notify ATK_STATE_ENABLED change when ATK_STATE_SENSITIVE changes if necessary.

Bug #615999.
parent 95fd5011
......@@ -138,7 +138,19 @@ gail_check_menu_item_real_notify_gtk (GObject *obj,
if (strcmp (pspec->name, "inconsistent") == 0)
atk_object_notify_state_change (atk_obj, ATK_STATE_ENABLED,
!gtk_check_menu_item_get_inconsistent (check_menu_item));
(gtk_widget_get_sensitive (GTK_WIDGET (check_menu_item)) &&
!gtk_check_menu_item_get_inconsistent (check_menu_item)));
else if (strcmp (pspec->name, "sensitive") == 0)
{
/* Need to override gailwidget behavior of notifying for ENABLED */
gboolean sensitive;
gboolean enabled;
sensitive = gtk_widget_get_sensitive (GTK_WIDGET (check_menu_item));
enabled = sensitive &&
!gtk_check_menu_item_get_inconsistent (check_menu_item);
atk_object_notify_state_change (atk_obj, ATK_STATE_SENSITIVE, sensitive);
atk_object_notify_state_change (atk_obj, ATK_STATE_ENABLED, enabled);
}
else
GAIL_WIDGET_CLASS (gail_check_menu_item_parent_class)->notify_gtk (obj, pspec);
}
......@@ -135,7 +135,19 @@ gail_check_sub_menu_item_real_notify_gtk (GObject *obj,
if (strcmp (pspec->name, "inconsistent") == 0)
atk_object_notify_state_change (atk_obj, ATK_STATE_ENABLED,
!gtk_check_menu_item_get_inconsistent (check_menu_item));
(gtk_widget_get_sensitive (GTK_WIDGET (check_menu_item)) &&
!gtk_check_menu_item_get_inconsistent (check_menu_item)));
else if (strcmp (pspec->name, "sensitive") == 0)
{
/* Need to override gailwidget behavior of notifying for ENABLED */
gboolean sensitive;
gboolean enabled;
sensitive = gtk_widget_get_sensitive (GTK_WIDGET (check_menu_item));
enabled = sensitive &&
!gtk_check_menu_item_get_inconsistent (check_menu_item);
atk_object_notify_state_change (atk_obj, ATK_STATE_SENSITIVE, sensitive);
atk_object_notify_state_change (atk_obj, ATK_STATE_ENABLED, enabled);
}
else
GAIL_WIDGET_CLASS (gail_check_sub_menu_item_parent_class)->notify_gtk (obj, pspec);
}
......@@ -122,7 +122,19 @@ gail_toggle_button_real_notify_gtk (GObject *obj,
if (strcmp (pspec->name, "inconsistent") == 0)
atk_object_notify_state_change (atk_obj, ATK_STATE_ENABLED,
!gtk_toggle_button_get_inconsistent (toggle_button));
(gtk_widget_get_sensitive (GTK_WIDGET (toggle_button)) &&
!gtk_toggle_button_get_inconsistent (toggle_button)));
else if (strcmp (pspec->name, "sensitive") == 0)
{
/* Need to override gailwidget behavior of notifying for ENABLED */
gboolean sensitive;
gboolean enabled;
sensitive = gtk_widget_get_sensitive (GTK_WIDGET (toggle_button));
enabled = sensitive &&
!gtk_toggle_button_get_inconsistent (toggle_button);
atk_object_notify_state_change (atk_obj, ATK_STATE_SENSITIVE, sensitive);
atk_object_notify_state_change (atk_obj, ATK_STATE_ENABLED, enabled);
}
else
GAIL_WIDGET_CLASS (gail_toggle_button_parent_class)->notify_gtk (obj, pspec);
}
......@@ -997,6 +997,9 @@ gail_widget_real_notify_gtk (GObject *obj,
return;
atk_object_notify_state_change (atk_obj, state, value);
if (state == ATK_STATE_SENSITIVE)
atk_object_notify_state_change (atk_obj, ATK_STATE_ENABLED, value);
}
static void
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment