]> Pileus Git - ~andy/gtk/commitdiff
GailEntry: remove idle if cell editing is canceled
authorMatthias Clasen <mclasen@redhat.com>
Fri, 18 Feb 2011 00:06:19 +0000 (19:06 -0500)
committerMatthias Clasen <mclasen@redhat.com>
Fri, 18 Feb 2011 00:06:19 +0000 (19:06 -0500)
This avoids warnings when cell editing is interrupted e.g. by
adding or removing a row.

modules/other/gail/gailentry.c

index f4a537d34057c907cbf31e6b3e1d05a30dbd44f7..5f239c82ff2e56275ef90a1d3b3b4f7f58f5326c 100644 (file)
@@ -296,6 +296,18 @@ gail_entry_real_notify_gtk (GObject                *obj,
     {
       text_setup (entry, gtk_entry);
     }
+  else if (strcmp (pspec->name, "editing-canceled") == 0)
+    {
+      gboolean canceled;
+
+      g_object_get (obj, "editing-canceled", &canceled, NULL);
+
+      if (entry->insert_idle_handler && canceled)
+        {
+          g_source_remove (entry->insert_idle_handler);
+          entry->insert_idle_handler = 0;
+        }
+    }
   else
     GAIL_WIDGET_CLASS (gail_entry_parent_class)->notify_gtk (obj, pspec);
 }