fix VST GUI swallowing for windows

This commit is contained in:
Robin Gareus 2014-04-18 01:54:59 +02:00
parent 2e63b84a10
commit 06b700abf2
4 changed files with 10 additions and 14 deletions

View 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));

View 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);

View 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; }

View 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