From 2551885fd6c168b6b2738e6197325324e1d52a00 Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Fri, 19 Sep 2014 12:39:02 +0100 Subject: Optimise case where scrollbar_set_extents call changes nothing. --- desktop/scrollbar.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'desktop/scrollbar.c') diff --git a/desktop/scrollbar.c b/desktop/scrollbar.c index 948009fb5..c4da77cc0 100644 --- a/desktop/scrollbar.c +++ b/desktop/scrollbar.c @@ -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) -- cgit v1.2.3