diff --git a/gtk2_ardour/session_dialog.logic.cc b/gtk2_ardour/session_dialog.logic.cc index 751186d1ae..65876b5dfc 100644 --- a/gtk2_ardour/session_dialog.logic.cc +++ b/gtk2_ardour/session_dialog.logic.cc @@ -84,6 +84,7 @@ void SessionDialog::init() _system_configuration_button.signal_clicked.connect (sigc::mem_fun (*this, &SessionDialog::on_system_configuration)); for (size_t i = 0; i < MAX_RECENT_SESSION_COUNTS; i++) { _recent_session_button[i]->signal_clicked.connect (sigc::mem_fun (*this, &SessionDialog::on_recent_session )); + _recent_session_button[i]->signal_double_clicked.connect (sigc::mem_fun (*this, &SessionDialog::on_recent_session_double_click )); } redisplay_system_configuration (); redisplay_recent_sessions(); @@ -310,6 +311,18 @@ SessionDialog::on_recent_session (WavesButton* clicked_button) _open_selected_button.set_sensitive (_selection_type == RecentSession); } +void +SessionDialog::on_recent_session_double_click (WavesButton*) +{ + // we suppose the first click, occurred prior to the second in the + // double click sequence has been processed correctly and now + // the job is just to respond with ok + + hide(); + response (Gtk::RESPONSE_ACCEPT); +} + + void SessionDialog::on_system_configuration (WavesButton* clicked_button) { diff --git a/gtk2_ardour/session_dialog.logic.h b/gtk2_ardour/session_dialog.logic.h index 70c01244fc..b18c63b468 100644 --- a/gtk2_ardour/session_dialog.logic.h +++ b/gtk2_ardour/session_dialog.logic.h @@ -77,6 +77,7 @@ void on_open_saved_session (WavesButton*); void on_new_session (WavesButton*); void on_recent_session (WavesButton*); + void on_recent_session_double_click (WavesButton*); void on_system_configuration (WavesButton*); bool on_delete_event (GdkEventAny*); diff --git a/gtk2_ardour/waves_button.cc b/gtk2_ardour/waves_button.cc index 6e720d0163..a816305bb0 100644 --- a/gtk2_ardour/waves_button.cc +++ b/gtk2_ardour/waves_button.cc @@ -275,23 +275,24 @@ WavesButton::on_size_request (Gtk::Requisition* req) req->width += _corner_radius; } - - bool WavesButton::on_button_press_event (GdkEventButton *ev) { - _pushed = true; - queue_draw (); - if (binding_proxy.button_press_handler (ev)) { - return true; - } - if (!_act_on_release) { - if (_action) { - _action->activate (); + if (ev->type == GDK_2BUTTON_PRESS) { + signal_double_clicked (this); + } else { + _pushed = true; + queue_draw (); + if (binding_proxy.button_press_handler (ev)) { return true; } + if (!_act_on_release) { + if (_action) { + _action->activate (); + return true; + } + } } - return false; } diff --git a/gtk2_ardour/waves_button.h b/gtk2_ardour/waves_button.h index 8b5c22b49b..4c953f7f11 100644 --- a/gtk2_ardour/waves_button.h +++ b/gtk2_ardour/waves_button.h @@ -50,8 +50,6 @@ class WavesButton : public CairoWidget , public Gtkmm2ext::Activatable void set_border_color(const char*); Glib::RefPtr layout() const { return _layout; } - sigc::signal1 signal_clicked; - boost::shared_ptr get_controllable() { return binding_proxy.get_controllable(); } void set_controllable (boost::shared_ptr c); void watch (); @@ -61,6 +59,9 @@ class WavesButton : public CairoWidget , public Gtkmm2ext::Activatable bool on_button_press_event (GdkEventButton*); bool on_button_release_event (GdkEventButton*); + sigc::signal1 signal_clicked; + sigc::signal1 signal_double_clicked; + protected: void render (cairo_t *); void on_size_request (Gtk::Requisition* req);