Commit ccbe6c81 authored by Benjamin Otte's avatar Benjamin Otte
Browse files

range: Do not use idles to trigger actions

parent 2870b586
......@@ -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;
}
......
......@@ -37,8 +37,6 @@ typedef struct _GtkRangeAccessibleClass GtkRangeAccessibleClass;
struct _GtkRangeAccessible
{
GtkWidgetAccessible parent;
guint action_idle_handler;
};
struct _GtkRangeAccessibleClass
......
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