[gtk+] Fix some problems with prelighting of icons in entries



commit 0e8fe66f094bdeb990c84a0a9b6e76eb6f3d049e
Author: Matthias Clasen <mclasen redhat com>
Date:   Mon Jul 13 14:48:10 2009 -0400

    Fix some problems with prelighting of icons in entries

 gtk/gtkentry.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtkentry.c b/gtk/gtkentry.c
index f73f19e..153951d 100644
--- a/gtk/gtkentry.c
+++ b/gtk/gtkentry.c
@@ -3555,6 +3555,10 @@ gtk_entry_leave_notify (GtkWidget        *widget,
 
       if (icon_info != NULL && event->window == icon_info->window)
         {
+          /* a grab means that we may never see the button release */
+          if (event->mode == GDK_CROSSING_GRAB || event->mode == GDK_CROSSING_GTK_GRAB)
+            icon_info->pressed = FALSE;
+
           if (should_prelight (entry, i))
             {
               icon_info->prelight = FALSE;
@@ -7991,9 +7995,14 @@ gtk_entry_set_icon_sensitive (GtkEntry             *entry,
     {
       icon_info->insensitive = !sensitive;
 
+      icon_info->pressed = FALSE;
+      icon_info->prelight = FALSE;
+
       if (GTK_WIDGET_REALIZED (GTK_WIDGET (entry)))
         update_cursors (GTK_WIDGET (entry));
 
+      gtk_widget_queue_draw (GTK_WIDGET (entry));
+
       g_object_notify (G_OBJECT (entry),
                        icon_pos == GTK_ENTRY_ICON_PRIMARY ? "primary-icon-sensitive" : "secondary-icon-sensitive");
     }



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