From f878fefeedf4bbe0ef6b2f9b788b5ff1b2ba1f7f Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Wed, 31 Aug 2011 13:04:50 +0000 Subject: [PATCH] Optimise out scrollbar action induced redraws with no effect. svn path=/trunk/netsurf/; revision=12688 --- desktop/scrollbar.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/desktop/scrollbar.c b/desktop/scrollbar.c index 1c4b46d47..e6fe83c90 100644 --- a/desktop/scrollbar.c +++ b/desktop/scrollbar.c @@ -397,6 +397,7 @@ bool scrollbar_redraw(struct scrollbar *s, int x, int y, void scrollbar_set(struct scrollbar *s, int value, bool bar_pos) { int well_length; + int old_offset = s->offset; struct scrollbar_msg_data msg; if (value < 0) @@ -426,6 +427,10 @@ void scrollbar_set(struct scrollbar *s, int value, bool bar_pos) ((well_length * s->offset) / s->full_size); } + if (s->offset == old_offset) + /* Nothing happened */ + return; + msg.scrollbar = s; msg.msg = SCROLLBAR_MSG_MOVED; msg.scroll_offset = s->offset;