[gtk+] a11y: Remove idle handler for switch action handling
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] a11y: Remove idle handler for switch action handling
- Date: Wed, 6 Jul 2011 14:50:34 +0000 (UTC)
commit 659d24c9ab03738f6c701e92456bd2fdae76e835
Author: Benjamin Otte <otte redhat com>
Date: Tue Jul 5 14:39:12 2011 +0200
a11y: Remove idle handler for switch action handling
gtk/a11y/gtkswitchaccessible.c | 44 ++-------------------------------------
gtk/a11y/gtkswitchaccessible.h | 2 -
2 files changed, 3 insertions(+), 43 deletions(-)
---
diff --git a/gtk/a11y/gtkswitchaccessible.c b/gtk/a11y/gtkswitchaccessible.c
index 71e9e91..2ca0451 100644
--- a/gtk/a11y/gtkswitchaccessible.c
+++ b/gtk/a11y/gtkswitchaccessible.c
@@ -56,17 +56,6 @@ gtk_switch_accessible_ref_state_set (AtkObject *accessible)
}
static void
-gtk_switch_accessible_finalize (GObject *obj)
-{
- GtkSwitchAccessible *accessible = (GtkSwitchAccessible *)obj;
-
- if (accessible->action_idle)
- g_source_remove (accessible->action_idle);
-
- G_OBJECT_CLASS (gtk_switch_accessible_parent_class)->finalize (obj);
-}
-
-static void
gtk_switch_accessible_initialize (AtkObject *accessible,
gpointer widget)
{
@@ -80,11 +69,8 @@ gtk_switch_accessible_initialize (AtkObject *accessible,
static void
gtk_switch_accessible_class_init (GtkSwitchAccessibleClass *klass)
{
- GObjectClass *object_class = G_OBJECT_CLASS (klass);
AtkObjectClass *atk_class = ATK_OBJECT_CLASS (klass);
- object_class->finalize = gtk_switch_accessible_finalize;
-
atk_class->initialize = gtk_switch_accessible_initialize;
atk_class->ref_state_set = gtk_switch_accessible_ref_state_set;
}
@@ -92,7 +78,6 @@ gtk_switch_accessible_class_init (GtkSwitchAccessibleClass *klass)
static void
gtk_switch_accessible_init (GtkSwitchAccessible *self)
{
- self->action_idle = 0;
}
static gint
@@ -112,31 +97,10 @@ gtk_switch_action_get_name (AtkAction *action,
}
static gboolean
-idle_do_action (gpointer data)
-{
- GtkSwitchAccessible *accessible = data;
- GtkWidget *widget;
- GtkSwitch *sw;
-
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (data));
- sw = GTK_SWITCH (widget);
-
- accessible->action_idle = 0;
-
- if (widget == NULL ||
- !gtk_widget_is_sensitive (widget) || !gtk_widget_get_visible (widget))
- return FALSE;
-
- gtk_switch_set_active (sw, !gtk_switch_get_active (sw));
-
- return FALSE;
-}
-
-static gboolean
gtk_switch_action_do_action (AtkAction *action,
gint i)
{
- GtkSwitchAccessible *accessible;
+ GtkSwitch *sw;
GtkWidget *widget;
widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (action));
@@ -149,10 +113,8 @@ gtk_switch_action_do_action (AtkAction *action,
if (!gtk_widget_is_sensitive (widget) || !gtk_widget_get_visible (widget))
return FALSE;
- accessible = (GtkSwitchAccessible *)action;
-
- if (!accessible->action_idle)
- accessible->action_idle = gdk_threads_add_idle (idle_do_action, accessible);
+ sw = GTK_SWITCH (widget);
+ gtk_switch_set_active (sw, !gtk_switch_get_active (sw));
return TRUE;
}
diff --git a/gtk/a11y/gtkswitchaccessible.h b/gtk/a11y/gtkswitchaccessible.h
index 694a83c..3cb66a9 100644
--- a/gtk/a11y/gtkswitchaccessible.h
+++ b/gtk/a11y/gtkswitchaccessible.h
@@ -37,8 +37,6 @@ typedef struct _GtkSwitchAccessibleClass GtkSwitchAccessibleClass;
struct _GtkSwitchAccessible
{
GtkWidgetAccessible parent;
-
- guint action_idle;
};
struct _GtkSwitchAccessibleClass
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]