diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2013-12-23 15:35:49 -0500 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2013-12-23 15:35:49 -0500 |
commit | 84f55440a3c6317dd2ab5d7e3d638016609e4d03 (patch) | |
tree | 2329f57523432a698f99927a2f070555fd31fe20 /gtk2_ardour/rc_option_editor.cc | |
parent | e1bca03857070ba390bba729933c2d72ad5169fd (diff) | |
parent | dc7878760da040ad74b077318d2e9868d427199a (diff) |
fix redrawing of canvas with an optimized build
Best guess right now is that optimization does something bad when ceil() is called twice on a very large dbl-precision number,
which results in a zero (empty) redraw area. Without the removal of the redundant ceil & floor functions, no expose events
would be delivered to the canvas in an optimized build during drags (and maybe more).
Diffstat (limited to 'gtk2_ardour/rc_option_editor.cc')
-rw-r--r-- | gtk2_ardour/rc_option_editor.cc | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/gtk2_ardour/rc_option_editor.cc b/gtk2_ardour/rc_option_editor.cc index da6d2344c2..3a5cab0289 100644 --- a/gtk2_ardour/rc_option_editor.cc +++ b/gtk2_ardour/rc_option_editor.cc @@ -648,6 +648,7 @@ class ControlSurfacesOptions : public OptionEditorBox public: ControlSurfacesOptions (Gtk::Window& parent) : _parent (parent) + , _ignore_view_change (0) { _store = ListStore::create (_model); _view.set_model (_store); @@ -700,9 +701,14 @@ private: void protocol_status_changed (ControlProtocolInfo* cpi) { /* find the row */ TreeModel::Children rows = _store->children(); + for (TreeModel::Children::iterator x = rows.begin(); x != rows.end(); ++x) { + string n = ((*x)[_model.name]); + if ((*x)[_model.protocol_info] == cpi) { + _ignore_view_change++; (*x)[_model.enabled] = (cpi->protocol || cpi->requested); + _ignore_view_change--; break; } } @@ -712,6 +718,10 @@ private: { TreeModel::Row r = *i; + if (_ignore_view_change) { + return; + } + ControlProtocolInfo* cpi = r[_model.protocol_info]; if (!cpi) { return; @@ -720,22 +730,23 @@ private: bool const was_enabled = (cpi->protocol != 0); bool const is_enabled = r[_model.enabled]; + if (was_enabled != is_enabled) { + if (!was_enabled) { - ControlProtocolManager::instance().instantiate (*cpi); + ControlProtocolManager::instance().activate (*cpi); } else { Gtk::Window* win = r[_model.editor]; if (win) { win->hide (); } - ControlProtocolManager::instance().teardown (*cpi); + ControlProtocolManager::instance().deactivate (*cpi); if (win) { delete win; + r[_model.editor] = 0; } - r[_model.editor] = 0; - cpi->requested = false; } } @@ -805,6 +816,7 @@ private: TreeView _view; Gtk::Window& _parent; PBD::ScopedConnection protocol_status_connection; + uint32_t _ignore_view_change; }; class VideoTimelineOptions : public OptionEditorBox |