diff options
author | Benjamin Otte <otte@redhat.com> | 2014-09-15 16:06:41 +0200 |
---|---|---|
committer | Benjamin Otte <otte@redhat.com> | 2014-09-15 16:35:40 +0200 |
commit | 86607c0f210cffee8b9484fb1ea38a54cf58d61a (patch) | |
tree | 74dfdd3a8da8662e302c243f4e6f59da2df1ff9e /gtk | |
parent | 45ab4ae09bade6f63bc71d4df0aa250c72afe1b2 (diff) | |
download | gtk+-86607c0f210cffee8b9484fb1ea38a54cf58d61a.tar.gz |
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.
Diffstat (limited to 'gtk')
-rw-r--r-- | gtk/gtkiconview.c | 26 |
1 files 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; |