cleaner code to figure out which Tabbable was just torn off
authorPaul Davis <paul@linuxaudiosystems.com>
Wed, 8 Jul 2015 19:38:04 +0000 (15:38 -0400)
committerPaul Davis <paul@linuxaudiosystems.com>
Mon, 22 Feb 2016 20:31:21 +0000 (15:31 -0500)
gtk2_ardour/ardour_ui_dependents.cc

index 031ebd58a88e0592fe2fb81cbf17dcef4d65e974..b99cc24db99df83a6938b4700a2101d82f47698c 100644 (file)
@@ -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 ();