[gtk+] a11y: Remove idle handler for expander actions



commit 3e49e2387cdc9bb122f35f5584a1f1b6d2be3251
Author: Benjamin Otte <otte redhat com>
Date:   Tue Jun 28 20:03:35 2011 +0200

    a11y: Remove idle handler for expander actions

 gtk/a11y/gailexpander.c |   33 +--------------------------------
 gtk/a11y/gailexpander.h |    1 -
 2 files changed, 1 insertions(+), 33 deletions(-)
---
diff --git a/gtk/a11y/gailexpander.c b/gtk/a11y/gailexpander.c
index e9d7c0b..d8234ba 100644
--- a/gtk/a11y/gailexpander.c
+++ b/gtk/a11y/gailexpander.c
@@ -49,7 +49,6 @@ static const gchar* gail_expander_get_full_text    (GtkExpander       *widget);
 static void                  atk_action_interface_init  (AtkActionIface *iface);
 static gboolean              gail_expander_do_action    (AtkAction      *action,
                                                          gint           i);
-static gboolean              idle_do_action             (gpointer       data);
 static gint                  gail_expander_get_n_actions(AtkAction      *action);
 static const gchar* gail_expander_get_keybinding
                                                         (AtkAction      *action,
@@ -85,7 +84,6 @@ static void
 gail_expander_init (GailExpander *expander)
 {
   expander->activate_keybinding = NULL;
-  expander->action_idle_handler = 0;
   expander->textutil = NULL;
 }
 
@@ -305,7 +303,6 @@ gail_expander_do_action (AtkAction *action,
                          gint      i)
 {
   GtkWidget *widget;
-  GailExpander *expander;
   gboolean return_value = TRUE;
 
   widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (action));
@@ -318,14 +315,10 @@ gail_expander_do_action (AtkAction *action,
   if (!gtk_widget_is_sensitive (widget) || !gtk_widget_get_visible (widget))
     return FALSE;
 
-  expander = GAIL_EXPANDER (action);
   switch (i)
     {
     case 0:
-      if (expander->action_idle_handler)
-        return_value = FALSE;
-      else
-	expander->action_idle_handler = gdk_threads_add_idle (idle_do_action, expander);
+      gtk_widget_activate (widget);
       break;
     default:
       return_value = FALSE;
@@ -334,25 +327,6 @@ gail_expander_do_action (AtkAction *action,
   return return_value; 
 }
 
-static gboolean
-idle_do_action (gpointer data)
-{
-  GtkWidget *widget;
-  GailExpander *gail_expander;
-
-  gail_expander = GAIL_EXPANDER (data);
-  gail_expander->action_idle_handler = 0;
-
-  widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (gail_expander));
-  if (widget == NULL /* State is defunct */ ||
-      !gtk_widget_is_sensitive (widget) || !gtk_widget_get_visible (widget))
-    return FALSE;
-
-  gtk_widget_activate (widget);
-
-  return FALSE;
-}
-
 static gint
 gail_expander_get_n_actions (AtkAction *action)
 {
@@ -454,11 +428,6 @@ gail_expander_finalize (GObject *object)
   GailExpander *expander = GAIL_EXPANDER (object);
 
   g_free (expander->activate_keybinding);
-  if (expander->action_idle_handler)
-    {
-      g_source_remove (expander->action_idle_handler);
-      expander->action_idle_handler = 0;
-    }
   if (expander->textutil)
     g_object_unref (expander->textutil);
 
diff --git a/gtk/a11y/gailexpander.h b/gtk/a11y/gailexpander.h
index 37969b4..9883b3d 100644
--- a/gtk/a11y/gailexpander.h
+++ b/gtk/a11y/gailexpander.h
@@ -40,7 +40,6 @@ struct _GailExpander
   GailContainer parent;
 
   gchar         *activate_keybinding;
-  guint         action_idle_handler;
 
   GailTextUtil   *textutil;
 };



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]