From 86607c0f210cffee8b9484fb1ea38a54cf58d61a Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Mon, 15 Sep 2014 16:06:41 +0200 Subject: [PATCH] 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 file changed, 14 insertions(+), 12 deletions(-) diff --git a/gtk/gtkiconview.c b/gtk/gtkiconview.c index fc3e6505ea..91efa40625 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;