From bcc0b2d27797d07bf48de1b3a03dea7f878cb2b6 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sat, 4 Jan 2014 02:45:30 +0000 Subject: Fix control updating with animated canvas. git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@5254 a436a847-0d15-0410-975c-d299462d15a1 --- src/gui/App.hpp | 2 +- src/gui/Port.cpp | 10 ++-------- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/src/gui/App.hpp b/src/gui/App.hpp index 1fca42ea..11915949 100644 --- a/src/gui/App.hpp +++ b/src/gui/App.hpp @@ -18,8 +18,8 @@ #define INGEN_GUI_APP_HPP #include -#include #include +#include #include #include diff --git a/src/gui/Port.cpp b/src/gui/Port.cpp index ad03bc3b..92775483 100644 --- a/src/gui/Port.cpp +++ b/src/gui/Port.cpp @@ -76,7 +76,6 @@ Port::Port(App& app, app.style()->get_port_color(pm.get())) , _app(app) , _port_model(pm) - , _pressed(false) , _entered(false) , _flipped(flip) { @@ -181,7 +180,7 @@ Port::on_value_changed(double value) void Port::value_changed(const Atom& value) { - if (!_pressed && value.type() == _app.forge().Float) { + if (value.type() == _app.forge().Float && !get_grabbed()) { Ganv::Port::set_control_value(value.get()); } } @@ -301,15 +300,10 @@ Port::on_event(GdkEvent* ev) return true; } } - _pressed = true; } else if (ev->button.button == 3) { return show_menu(&ev->button); } break; - case GDK_BUTTON_RELEASE: - if (ev->button.button == 1) { - _pressed = false; - } default: break; } @@ -416,7 +410,7 @@ Port::property_changed(const Raul::URI& key, const Atom& value) const URIs& uris = _app.uris(); if (value.type() == uris.forge.Float) { float val = value.get(); - if (key == uris.ingen_value && !_pressed) { + if (key == uris.ingen_value && !get_grabbed()) { Ganv::Port::set_control_value(val); } else if (key == uris.lv2_minimum) { if (model()->port_property(uris.lv2_sampleRate)) { -- cgit v1.2.1