Optimise out scrollbar action induced redraws with no effect.

svn path=/trunk/netsurf/; revision=12688
This commit is contained in:
Michael Drake 2011-08-31 13:04:50 +00:00
parent c35b92acc1
commit f878fefeed
1 changed files with 5 additions and 0 deletions

View File

@ -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;