Optimise case where scrollbar_set_extents call changes nothing.

This commit is contained in:
Michael Drake 2014-09-19 12:39:02 +01:00
parent 5b96a84ef7
commit 2551885fd6
1 changed files with 6 additions and 0 deletions

View File

@ -514,6 +514,12 @@ void scrollbar_set_extents(struct scrollbar *s, int length,
int well_length;
struct scrollbar_msg_data msg;
if (length == s->length && visible_size == s->visible_size &&
full_size == s->full_size) {
/* Nothing's changed. */
return;
}
if (length != -1)
s->length = length;
if (visible_size != -1)