From 54e981f0d3599fc7413a30c00562b3ea789e2fe7 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Fri, 5 Oct 2007 06:01:39 +0000 Subject: Fix ridiculous CPU chewing on embedded LV2 GUIs. For some reason the GUI widget's size request signal fires continuously... this needs fixing. git-svn-id: http://svn.drobilla.net/lad/ingen@824 a436a847-0d15-0410-975c-d299462d15a1 --- src/libs/client/OSCClientReceiver.cpp | 2 +- src/libs/gui/NodeModule.cpp | 11 +++++++++++ src/libs/gui/NodeModule.hpp | 2 ++ 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/libs/client/OSCClientReceiver.cpp b/src/libs/client/OSCClientReceiver.cpp index b9f5a70d..0a1fa105 100644 --- a/src/libs/client/OSCClientReceiver.cpp +++ b/src/libs/client/OSCClientReceiver.cpp @@ -35,7 +35,7 @@ OSCClientReceiver::OSCClientReceiver(int listen_port) _listen_port(listen_port), _st(NULL) { - start(false); + start(true); } diff --git a/src/libs/gui/NodeModule.cpp b/src/libs/gui/NodeModule.cpp index ed05c859..fef7b648 100644 --- a/src/libs/gui/NodeModule.cpp +++ b/src/libs/gui/NodeModule.cpp @@ -41,6 +41,8 @@ NodeModule::NodeModule(boost::shared_ptr canvas, SharedPtrwidth && _last_gui_request_height == r->height) + return; + if (r->width + 4 > _width) set_minimum_width(r->width + 4); @@ -215,6 +223,9 @@ NodeModule::gui_size_request(Gtk::Requisition* r) _ports_y_offset = r->height + 2; resize(); + + _last_gui_request_width = r->width; + _last_gui_request_height = r->height; } diff --git a/src/libs/gui/NodeModule.hpp b/src/libs/gui/NodeModule.hpp index ce4d88c4..14be9dee 100644 --- a/src/libs/gui/NodeModule.hpp +++ b/src/libs/gui/NodeModule.hpp @@ -90,6 +90,8 @@ protected: SLV2UIInstance _slv2_ui; Gtk::Widget* _gui; Gnome::Canvas::Widget* _gui_item; + int _last_gui_request_width; + int _last_gui_request_height; }; -- cgit v1.2.1