make PluginUIWindow inherit from ArdourWindow not GtkWindow
authorPaul Davis <paul@linuxaudiosystems.com>
Thu, 2 May 2013 14:11:57 +0000 (10:11 -0400)
committerPaul Davis <paul@linuxaudiosystems.com>
Thu, 2 May 2013 14:11:57 +0000 (10:11 -0400)
gtk2_ardour/plugin_ui.cc
gtk2_ardour/plugin_ui.h
gtk2_ardour/processor_box.cc

index 5b281f33ab9bde78c1690ea4a503391888822620..bab081b6006af55a4ac077d6e78548f8b3e64f38 100644 (file)
@@ -82,11 +82,10 @@ using namespace Gtkmm2ext;
 using namespace Gtk;
 
 PluginUIWindow::PluginUIWindow (
-       Gtk::Window*                    win,
        boost::shared_ptr<PluginInsert> insert,
        bool                            scrollable,
        bool                            editor)
-       : parent (win)
+       : ArdourWindow (string())
        , was_visible (false)
        , _keyboard_focused (false)
 #ifdef AUDIOUNIT_SUPPORT
@@ -96,7 +95,6 @@ PluginUIWindow::PluginUIWindow (
 
 {
        bool have_gui = false;
-
        Label* label = manage (new Label());
        label->set_markup ("<b>THIS IS THE PLUGIN UI</b>");
 
@@ -147,7 +145,6 @@ PluginUIWindow::PluginUIWindow (
                signal_unmap_event().connect (sigc::mem_fun (*pu, &GenericPluginUI::stop_updating));
        }
 
-       // set_position (Gtk::WIN_POS_MOUSE);
        set_name ("PluginEditor");
        add_events (Gdk::KEY_PRESS_MASK|Gdk::KEY_RELEASE_MASK|Gdk::BUTTON_PRESS_MASK|Gdk::BUTTON_RELEASE_MASK);
 
@@ -163,6 +160,7 @@ PluginUIWindow::PluginUIWindow (
 
        set_default_size (w, h);
        set_resizable (_pluginui->resizable());
+       set_position (Gtk::WIN_POS_MOUSE);
 }
 
 PluginUIWindow::~PluginUIWindow ()
@@ -170,19 +168,10 @@ PluginUIWindow::~PluginUIWindow ()
        delete _pluginui;
 }
 
-void
-PluginUIWindow::set_parent (Gtk::Window* win)
-{
-       parent = win;
-}
-
 void
 PluginUIWindow::on_map ()
 {
        Window::on_map ();
-#ifdef __APPLE__
-       set_keep_above (true);
-#endif // __APPLE__
 }
 
 bool
@@ -236,10 +225,6 @@ PluginUIWindow::on_show ()
                        Window::on_show ();
                }
        }
-
-       if (parent) {
-               // set_transient_for (*parent);
-       }
 }
 
 void
index 6b886cf268a259778f420bba891fb627311da3a2..be03e6ede46b58bbc705a27979c69285e1113b76 100644 (file)
@@ -50,6 +50,7 @@
 
 #include "automation_controller.h"
 #include "ardour_button.h"
+#include "ardour_window.h"
 
 namespace ARDOUR {
        class PluginInsert;
@@ -278,11 +279,10 @@ class GenericPluginUI : public PlugUIBase, public Gtk::VBox
        bool integer_printer (char* buf, Gtk::Adjustment &, ControlUI *);
 };
 
-class PluginUIWindow : public Gtk::Window
+class PluginUIWindow : public ArdourWindow
 {
   public:
-       PluginUIWindow (Gtk::Window*,
-                       boost::shared_ptr<ARDOUR::PluginInsert> insert,
+       PluginUIWindow (boost::shared_ptr<ARDOUR::PluginInsert> insert,
                        bool scrollable=false,
                        bool editor=true);
        ~PluginUIWindow ();
index 16088786cdeb808d38caceafc297069db39fbea2..3618f437a283fd68172198e02689cb3d41e772f2 100644 (file)
@@ -2094,20 +2094,16 @@ ProcessorBox::toggle_edit_processor (boost::shared_ptr<Processor> processor)
 
                /* these are both allowed to be null */
 
-               Container* toplevel = get_toplevel();
-               Window* win = dynamic_cast<Gtk::Window*>(toplevel);
-
                Window* w = get_processor_ui (plugin_insert);
 
                if (w == 0) {
 
-                       plugin_ui = new PluginUIWindow (win, plugin_insert);
+                       plugin_ui = new PluginUIWindow (plugin_insert);
                        plugin_ui->set_title (generate_processor_title (plugin_insert));
                        set_processor_ui (plugin_insert, plugin_ui);
 
                } else {
                        plugin_ui = dynamic_cast<PluginUIWindow *> (w);
-                       plugin_ui->set_parent (win);
                }
 
                gidget = plugin_ui;
@@ -2155,9 +2151,7 @@ ProcessorBox::toggle_edit_generic_processor (boost::shared_ptr<Processor> proces
                return;
        }
 
-       Container*      toplevel  = get_toplevel();
-       Window*         win       = dynamic_cast<Gtk::Window*>(toplevel);
-       PluginUIWindow* plugin_ui = new PluginUIWindow(win, plugin_insert, true, false);
+       PluginUIWindow* plugin_ui = new PluginUIWindow (plugin_insert, true, false);
        plugin_ui->set_title(generate_processor_title (plugin_insert));
 
        if (plugin_ui->is_visible()) {