diff --git a/gtk2_ardour/mixer_ui.cc b/gtk2_ardour/mixer_ui.cc index 39158f6779..ab43772552 100644 --- a/gtk2_ardour/mixer_ui.cc +++ b/gtk2_ardour/mixer_ui.cc @@ -243,8 +243,14 @@ Mixer_UI::Mixer_UI () list_vpacker.pack_start (rhs_pane2, true, true); + vca_scroller_base.add_events (Gdk::BUTTON_PRESS_MASK|Gdk::BUTTON_RELEASE_MASK); + vca_scroller_base.set_name ("MixerWindow"); + vca_scroller_base.signal_button_release_event().connect (sigc::mem_fun(*this, &Mixer_UI::masters_scroller_button_release), false); + vca_packer.pack_end (vca_scroller_base, true, true); + vca_scroller.add (vca_packer); vca_scroller.set_policy (Gtk::POLICY_ALWAYS, Gtk::POLICY_AUTOMATIC); + vca_scroller.signal_button_release_event().connect (sigc::mem_fun(*this, &Mixer_UI::strip_scroller_button_release)); inner_pane.pack1 (scroller); inner_pane.pack2 (vca_scroller); @@ -291,9 +297,10 @@ Mixer_UI::Mixer_UI () rhs_pane1.show(); rhs_pane2.show(); strip_packer.show(); - inner_pane.show (); + inner_pane.show(); vca_scroller.show(); vca_packer.show(); + vca_scroller_base.show(); out_packer.show(); list_hpane.show(); group_display.show(); @@ -412,6 +419,19 @@ Mixer_UI::remove_master (VCAMasterStrip* vms) } } +bool +Mixer_UI::masters_scroller_button_release (GdkEventButton* ev) +{ + using namespace Menu_Helpers; + + if (Keyboard::is_context_menu_event (ev)) { + ARDOUR_UI::instance()->add_route (); + return true; + } + + return false; +} + void Mixer_UI::add_strips (RouteList& routes) { @@ -1216,6 +1236,7 @@ Mixer_UI::redisplay_track_list () uint32_t n_masters = 0; container_clear (vca_packer); + vca_packer.pack_end (vca_scroller_base, true, true); for (i = rows.begin(); i != rows.end(); ++i) { diff --git a/gtk2_ardour/mixer_ui.h b/gtk2_ardour/mixer_ui.h index 78fde73962..544578c091 100644 --- a/gtk2_ardour/mixer_ui.h +++ b/gtk2_ardour/mixer_ui.h @@ -134,23 +134,24 @@ class Mixer_UI : public Gtkmm2ext::Tabbable, public PBD::ScopedConnectionList, p Gtk::HBox scroller_hpacker; Gtk::VBox mixer_scroller_vpacker; Gtk::VBox list_vpacker; - Gtk::Label group_display_button_label; - Gtk::Button group_display_button; - Gtk::ScrolledWindow track_display_scroller; - Gtk::ScrolledWindow group_display_scroller; - Gtk::ScrolledWindow favorite_plugins_scroller; - Gtk::VBox group_display_vbox; - Gtk::Frame track_display_frame; - Gtk::Frame group_display_frame; - Gtk::Frame favorite_plugins_frame; - Gtk::VPaned rhs_pane1; - Gtk::VPaned rhs_pane2; - Gtk::HPaned inner_pane; - Gtk::HBox strip_packer; - Gtk::ScrolledWindow vca_scroller; - Gtk::HBox vca_packer; - Gtk::HBox out_packer; - Gtk::HPaned list_hpane; + Gtk::Label group_display_button_label; + Gtk::Button group_display_button; + Gtk::ScrolledWindow track_display_scroller; + Gtk::ScrolledWindow group_display_scroller; + Gtk::ScrolledWindow favorite_plugins_scroller; + Gtk::VBox group_display_vbox; + Gtk::Frame track_display_frame; + Gtk::Frame group_display_frame; + Gtk::Frame favorite_plugins_frame; + Gtk::VPaned rhs_pane1; + Gtk::VPaned rhs_pane2; + Gtk::HPaned inner_pane; + Gtk::HBox strip_packer; + Gtk::ScrolledWindow vca_scroller; + Gtk::HBox vca_packer; + Gtk::EventBox vca_scroller_base; + Gtk::HBox out_packer; + Gtk::HPaned list_hpane; MixerGroupTabs* _group_tabs; @@ -162,6 +163,7 @@ class Mixer_UI : public Gtkmm2ext::Tabbable, public PBD::ScopedConnectionList, p void scroller_drag_data_received (const Glib::RefPtr&, int, int, const Gtk::SelectionData&, guint, guint); bool strip_scroller_button_release (GdkEventButton*); + bool masters_scroller_button_release (GdkEventButton*); void scroll_left (); void scroll_right (); void toggle_midi_input_active (bool flip_others);