[gtk+] iconview: Don't queue redraws when nothing changes



commit 86607c0f210cffee8b9484fb1ea38a54cf58d61a
Author: Benjamin Otte <otte redhat com>
Date:   Mon Sep 15 16:06:41 2014 +0200

    iconview: Don't queue redraws when nothing changes
    
    We were queueing redraws for the old and the new prelit item, even when
    they were the same item.

 gtk/gtkiconview.c |   26 ++++++++++++++------------
 1 files changed, 14 insertions(+), 12 deletions(-)
---
diff --git a/gtk/gtkiconview.c b/gtk/gtkiconview.c
index fc3e650..91efa40 100644
--- a/gtk/gtkiconview.c
+++ b/gtk/gtkiconview.c
@@ -2038,21 +2038,23 @@ gtk_icon_view_motion (GtkWidget      *widget,
                                                FALSE,
                                                &cell);
 
-      if (item != NULL)
+      if (item != last_prelight_item)
         {
-          item->prelight = TRUE;
-          gtk_icon_view_queue_draw_item (icon_view, item);
-        }
+          if (item != NULL)
+            {
+              item->prelight = TRUE;
+              gtk_icon_view_queue_draw_item (icon_view, item);
+            }
 
-      if (last_prelight_item != NULL &&
-          last_prelight_item != item)
-        {
-          last_prelight_item->prelight = FALSE;
-          gtk_icon_view_queue_draw_item (icon_view,
-                                         icon_view->priv->last_prelight);
-        }
+          if (last_prelight_item != NULL)
+            {
+              last_prelight_item->prelight = FALSE;
+              gtk_icon_view_queue_draw_item (icon_view,
+                                             icon_view->priv->last_prelight);
+            }
 
-      icon_view->priv->last_prelight = item;
+          icon_view->priv->last_prelight = item;
+        }
     }
   
   return TRUE;


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