range: Do not use idles to trigger actions

This commit is contained in:
Benjamin Otte 2011-07-05 14:34:10 +02:00
parent 2870b58638
commit ccbe6c816b
2 changed files with 1 additions and 32 deletions

View File

@ -82,12 +82,6 @@ gtk_range_accessible_finalize (GObject *object)
range);
}
if (range->action_idle_handler)
{
g_source_remove (range->action_idle_handler);
range->action_idle_handler = 0;
}
G_OBJECT_CLASS (gtk_range_accessible_parent_class)->finalize (object);
}
@ -234,30 +228,10 @@ atk_value_interface_init (AtkValueIface *iface)
iface->set_current_value = gtk_range_accessible_set_current_value;
}
static gboolean
idle_do_action (gpointer data)
{
GtkRangeAccessible *range = GTK_RANGE_ACCESSIBLE (data);
GtkWidget *widget;
range->action_idle_handler = 0;
widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (range));
if (widget == NULL)
return FALSE;
if (!gtk_widget_get_sensitive (widget) || !gtk_widget_get_visible (widget))
return FALSE;
gtk_widget_activate (widget);
return TRUE;
}
static gboolean
gtk_range_accessible_do_action (AtkAction *action,
gint i)
{
GtkRangeAccessible *range = GTK_RANGE_ACCESSIBLE (action);
GtkWidget *widget;
widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (action));
@ -270,10 +244,7 @@ gtk_range_accessible_do_action (AtkAction *action,
if (i != 0)
return FALSE;
if (range->action_idle_handler)
return FALSE;
range->action_idle_handler = gdk_threads_add_idle (idle_do_action, range);
gtk_widget_activate (widget);
return TRUE;
}

View File

@ -37,8 +37,6 @@ typedef struct _GtkRangeAccessibleClass GtkRangeAccessibleClass;
struct _GtkRangeAccessible
{
GtkWidgetAccessible parent;
guint action_idle_handler;
};
struct _GtkRangeAccessibleClass