range: Do not use idles to trigger actions
This commit is contained in:
parent
2870b58638
commit
ccbe6c816b
@ -82,12 +82,6 @@ gtk_range_accessible_finalize (GObject *object)
|
|||||||
range);
|
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);
|
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;
|
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
|
static gboolean
|
||||||
gtk_range_accessible_do_action (AtkAction *action,
|
gtk_range_accessible_do_action (AtkAction *action,
|
||||||
gint i)
|
gint i)
|
||||||
{
|
{
|
||||||
GtkRangeAccessible *range = GTK_RANGE_ACCESSIBLE (action);
|
|
||||||
GtkWidget *widget;
|
GtkWidget *widget;
|
||||||
|
|
||||||
widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (action));
|
widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (action));
|
||||||
@ -270,10 +244,7 @@ gtk_range_accessible_do_action (AtkAction *action,
|
|||||||
if (i != 0)
|
if (i != 0)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
if (range->action_idle_handler)
|
gtk_widget_activate (widget);
|
||||||
return FALSE;
|
|
||||||
|
|
||||||
range->action_idle_handler = gdk_threads_add_idle (idle_do_action, range);
|
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
@ -37,8 +37,6 @@ typedef struct _GtkRangeAccessibleClass GtkRangeAccessibleClass;
|
|||||||
struct _GtkRangeAccessible
|
struct _GtkRangeAccessible
|
||||||
{
|
{
|
||||||
GtkWidgetAccessible parent;
|
GtkWidgetAccessible parent;
|
||||||
|
|
||||||
guint action_idle_handler;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
struct _GtkRangeAccessibleClass
|
struct _GtkRangeAccessibleClass
|
||||||
|
Loading…
Reference in New Issue
Block a user