diff --git a/gtk2_ardour/group_tabs.cc b/gtk2_ardour/group_tabs.cc index c1e4f6d078..f390c6b28c 100644 --- a/gtk2_ardour/group_tabs.cc +++ b/gtk2_ardour/group_tabs.cc @@ -98,6 +98,10 @@ GroupTabs::on_button_press_event (GdkEventButton* ev) { using namespace Menu_Helpers; + if (!get_sensitive ()) { + return true; + } + double const p = primary_coordinate (ev->x, ev->y); list::iterator prev; @@ -253,18 +257,28 @@ void GroupTabs::render (Cairo::RefPtr const& ctx, cairo_rectangle_t*) { cairo_t* cr = ctx->cobj(); - if (_dragging == 0) { - _tabs = compute_tabs (); + Gdk::Color c; + + if (!get_sensitive ()) { + c = get_style()->get_base (Gtk::STATE_INSENSITIVE); + } else { + c = get_style()->get_base (Gtk::STATE_NORMAL); } /* background */ - Gdk::Color c = get_style()->get_base (Gtk::STATE_NORMAL); - cairo_set_source_rgb (cr, c.get_red_p(), c.get_green_p(), c.get_blue_p()); cairo_rectangle (cr, 0, 0, get_width(), get_height()); cairo_fill (cr); + if (!get_sensitive ()) { + return; + } + + if (_dragging == 0) { + _tabs = compute_tabs (); + } + /* tabs */ for (list::const_iterator i = _tabs.begin(); i != _tabs.end(); ++i) { @@ -272,7 +286,6 @@ GroupTabs::render (Cairo::RefPtr const& ctx, cairo_rectangle_t*) } } - /** Convert a click position to a tab. * @param c Click position. * @param prev Filled in with the previous tab to the click, or _tabs.end().