From a122a209782e5b5400b5a70bd23ce4feadc6b36b Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Wed, 26 Jun 2013 20:09:55 +0300 Subject: [PATCH] Don't trigger widget rebuild if only its position changes --- source/widget.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/source/widget.cpp b/source/widget.cpp index 7496f8b..2183be6 100644 --- a/source/widget.cpp +++ b/source/widget.cpp @@ -63,9 +63,14 @@ void Widget::autosize() void Widget::set_geometry(const Geometry &g) { + bool size_changed = (g.w!=geom.w || g.h!=geom.h); geom = g; - on_geometry_change(); - rebuild(); + if(size_changed) + { + // TODO maybe rename this to on_size_change + on_geometry_change(); + rebuild(); + } } void Widget::set_parent(Container *p) -- 2.45.2