[gtk+/a11y] a11y: Remove idle handler from GailButton
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/a11y] a11y: Remove idle handler from GailButton
- Date: Wed, 29 Jun 2011 15:12:56 +0000 (UTC)
commit e2f80a51f45711c555d7ed7977d47ebcc7a3454f
Author: Benjamin Otte <otte redhat com>
Date: Tue Jun 28 19:26:10 2011 +0200
a11y: Remove idle handler from GailButton
gtk/a11y/gailbutton.c | 60 +------------------------------------------------
gtk/a11y/gailbutton.h | 2 -
2 files changed, 1 insertions(+), 61 deletions(-)
---
diff --git a/gtk/a11y/gailbutton.c b/gtk/a11y/gailbutton.c
index 0eb4ad2..6885cf4 100644
--- a/gtk/a11y/gailbutton.c
+++ b/gtk/a11y/gailbutton.c
@@ -57,7 +57,6 @@ static gint gail_button_real_add_gtk (GtkContainer
static void atk_action_interface_init (AtkActionIface *iface);
static gboolean gail_button_do_action (AtkAction *action,
gint i);
-static gboolean idle_do_action (gpointer data);
static gint gail_button_get_n_actions (AtkAction *action);
static const gchar* gail_button_get_keybinding (AtkAction *action,
gint i);
@@ -169,8 +168,6 @@ static void
gail_button_init (GailButton *button)
{
button->click_keybinding = NULL;
- button->action_queue = NULL;
- button->action_idle_handler = 0;
button->textutil = NULL;
}
@@ -410,7 +407,6 @@ gail_button_do_action (AtkAction *action,
gint i)
{
GtkWidget *widget;
- GailButton *button;
gboolean return_value = TRUE;
widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (action));
@@ -423,20 +419,10 @@ gail_button_do_action (AtkAction *action,
if (!gtk_widget_is_sensitive (widget) || !gtk_widget_get_visible (widget))
return FALSE;
- button = GAIL_BUTTON (action);
-
switch (i)
{
case 0:
- case 1:
- case 2:
- if (!button->action_queue)
- {
- button->action_queue = g_queue_new ();
- }
- g_queue_push_head (button->action_queue, GINT_TO_POINTER(i));
- if (!button->action_idle_handler)
- button->action_idle_handler = gdk_threads_add_idle (idle_do_action, button);
+ gtk_button_clicked (GTK_BUTTON (widget));
break;
default:
return_value = FALSE;
@@ -445,41 +431,6 @@ gail_button_do_action (AtkAction *action,
return return_value;
}
-static gboolean
-idle_do_action (gpointer data)
-{
- GtkButton *button;
- GtkWidget *widget;
- GailButton *gail_button;
-
- gail_button = GAIL_BUTTON (data);
- gail_button->action_idle_handler = 0;
- widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (gail_button));
-
- if (widget == NULL /* State is defunct */ ||
- !gtk_widget_is_sensitive (widget) || !gtk_widget_get_visible (widget))
- return FALSE;
-
- g_object_ref (gail_button);
-
- button = GTK_BUTTON (widget);
- while (!g_queue_is_empty (gail_button->action_queue))
- {
- gint action_number = GPOINTER_TO_INT(g_queue_pop_head (gail_button->action_queue));
- switch (action_number)
- {
- case 0:
- gtk_button_clicked (button);
- break;
- default:
- g_assert_not_reached ();
- break;
- }
- }
- g_object_unref (gail_button);
- return FALSE;
-}
-
static gint
gail_button_get_n_actions (AtkAction *action)
{
@@ -1227,15 +1178,6 @@ gail_button_finalize (GObject *object)
GailButton *button = GAIL_BUTTON (object);
g_free (button->click_keybinding);
- if (button->action_idle_handler)
- {
- g_source_remove (button->action_idle_handler);
- button->action_idle_handler = 0;
- }
- if (button->action_queue)
- {
- g_queue_free (button->action_queue);
- }
if (button->textutil)
{
g_object_unref (button->textutil);
diff --git a/gtk/a11y/gailbutton.h b/gtk/a11y/gailbutton.h
index 26825d8..38b95e7 100644
--- a/gtk/a11y/gailbutton.h
+++ b/gtk/a11y/gailbutton.h
@@ -45,8 +45,6 @@ struct _GailButton
gint8 state;
gchar *click_keybinding;
- guint action_idle_handler;
- GQueue *action_queue;
GailTextUtil *textutil;
};
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]