fix VST GUI swallowing for windows
authorRobin Gareus <robin@gareus.org>
Thu, 17 Apr 2014 23:54:59 +0000 (01:54 +0200)
committerRobin Gareus <robin@gareus.org>
Thu, 17 Apr 2014 23:54:59 +0000 (01:54 +0200)
gtk2_ardour/plugin_ui.cc
gtk2_ardour/windows_vst_plugin_ui.cc
gtk2_ardour/windows_vst_plugin_ui.h
libs/fst/vstwin.c

index ac5f7fd9a627b02e339f0fd7b048f6d0c2bd013e..190fd2ad969bddb5f6b1a0c253fc86aa8ac0fbe0 100644 (file)
@@ -227,7 +227,7 @@ PluginUIWindow::create_windows_vst_editor(boost::shared_ptr<PluginInsert>)
                      << endmsg;
                throw failed_constructor ();
        } else {
-               WindowsVSTPluginUI* vpu = new WindowsVSTPluginUI (insert, vp);
+               WindowsVSTPluginUI* vpu = new WindowsVSTPluginUI (insert, vp, GTK_WIDGET(this->gobj()));
 
                _pluginui = vpu;
                _pluginui->KeyboardFocused.connect (sigc::mem_fun (*this, &PluginUIWindow::keyboard_focused));
index 1ce83f8992bd3b10d159493d44d7636bbf83fce4..45111f840d00b82c0f751e4778564f52a1e6109c 100644 (file)
@@ -38,22 +38,18 @@ using namespace Gtk;
 using namespace ARDOUR;
 using namespace PBD;
 
-WindowsVSTPluginUI::WindowsVSTPluginUI (boost::shared_ptr<PluginInsert> pi, boost::shared_ptr<VSTPlugin> vp)
+WindowsVSTPluginUI::WindowsVSTPluginUI (boost::shared_ptr<PluginInsert> pi, boost::shared_ptr<VSTPlugin> vp, GtkWidget *parent)
        : VSTPluginUI (pi, vp)
 {
 
 #ifdef GDK_WINDOWING_WIN32
-
-#if 0 // TODO verify window vs vbox-widget WRT to plugin_analysis_expander
-       GtkWindow* wobj = GTK_WINDOW(gtk_widget_get_toplevel(this->gobj()));
-#else
-       GtkVBox* wobj = this->gobj();
-#endif
-
-       gtk_widget_realize(GTK_WIDGET(wobj));
-       void* hWndHost = gdk_win32_drawable_get_handle(GTK_WIDGET(wobj)->window);
+       gtk_widget_realize(parent);
+       void* hWndHost = gdk_win32_drawable_get_handle(parent->window);
 
        fst_run_editor (_vst->state(), hWndHost);
+       // TODO pack a placeholder (compare to VSTPluginUI::VSTPluginUI X11 socket)
+       // have placeholder use VSTPluginUI::get_preferred_height(), width()
+       // TODO pack plugin_analysis_expander at the bottom.
 #else
        fst_run_editor (_vst->state(), NULL);
        pack_start (plugin_analysis_expander, true, true);
index 7b23f2cb33a8c421db8e0a832637ec136fbbee6e..2fa0bbc7055b0b4bd5d99a5b99726016e3459142 100644 (file)
@@ -22,7 +22,7 @@
 class WindowsVSTPluginUI : public VSTPluginUI
 {
 public:
-       WindowsVSTPluginUI (boost::shared_ptr<ARDOUR::PluginInsert>, boost::shared_ptr<ARDOUR::VSTPlugin>);
+       WindowsVSTPluginUI (boost::shared_ptr<ARDOUR::PluginInsert>, boost::shared_ptr<ARDOUR::VSTPlugin>, GtkWidget *parent);
        ~WindowsVSTPluginUI ();
 
        bool start_updating (GdkEventAny*) { return false; }
index a55d4e59aa51f20dbd8637bf7d947bd96ad8ec87..27fb3cbead21af949eb87ed6361e4d21df356f61 100644 (file)
@@ -223,7 +223,7 @@ fst_new (void)
        fst->n_pending_keys = 0;
        fst->has_editor = 0;
 #ifdef PLATFORM_WINDOWS
-       fst->voffset = 36;
+       fst->voffset = 50;
        fst->hoffset = 0;
 #else /* linux + wine */
        fst->voffset = 24;
@@ -465,7 +465,7 @@ fst_move_window_into_view (VSTState* fst)
 {
        if (fst->windows_window) {
 #ifdef PLATFORM_WINDOWS
-               SetWindowPos ((HWND)(fst->windows_window), 0, fst->hoffset, fst->voffset, fst->width, fst->height, 0);
+               SetWindowPos ((HWND)(fst->windows_window), 0, fst->hoffset, fst->voffset, fst->width + fst->hoffset, fst->height + fst->voffset, 0);
 #else /* linux + wine */
                SetWindowPos ((HWND)(fst->windows_window), 0, 0, 0, fst->width + fst->hoffset, fst->height + fst->voffset, 0);
 #endif