From 26a9471b6143b97b75ff9d65611365ba2c1029b4 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Wed, 8 Jul 2015 15:38:04 -0400 Subject: [PATCH] cleaner code to figure out which Tabbable was just torn off --- gtk2_ardour/ardour_ui_dependents.cc | 28 ++++++++++++---------------- 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/gtk2_ardour/ardour_ui_dependents.cc b/gtk2_ardour/ardour_ui_dependents.cc index 031ebd58a8..b99cc24db9 100644 --- a/gtk2_ardour/ardour_ui_dependents.cc +++ b/gtk2_ardour/ardour_ui_dependents.cc @@ -114,26 +114,22 @@ ARDOUR_UI::tab_window_root_drop (GtkNotebook* src, using namespace std; Gtk::Notebook* nb = 0; Gtk::Window* win = 0; - - if (w == GTK_WIDGET(mixer->contents().gobj())) { - /* Mixer */ - - cerr << "Call use own window, mixer\n"; - - nb = mixer->tab_root_drop (); - win = mixer->own_window (); - - } else if (w == GTK_WIDGET(editor->contents().gobj())) { + Gtkmm2ext::Tabbable* tabbable = 0; - /* Editor */ - - cerr << "Call use own window, editor\n"; - - nb = editor->tab_root_drop (); - win = editor->own_window (); + if (w == GTK_WIDGET(editor->contents().gobj())) { + tabbable = editor; + } else if (w == GTK_WIDGET(mixer->contents().gobj())) { + tabbable = mixer; + } else if (w == GTK_WIDGET(rc_option_editor->contents().gobj())) { + tabbable = rc_option_editor; + } else { + return 0; } + nb = tabbable->tab_root_drop (); + win = tabbable->own_window (); + if (nb) { win->move (x, y); win->show_all (); -- 2.30.2