From: Mikko Rasa Date: Wed, 26 Jun 2013 17:09:55 +0000 (+0300) Subject: Don't trigger widget rebuild if only its position changes X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=a122a209782e5b5400b5a70bd23ce4feadc6b36b;p=libs%2Fgltk.git Don't trigger widget rebuild if only its position changes --- 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)