summaryrefslogtreecommitdiff
path: root/gtk2_ardour/vst_pluginui.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2009-02-19 14:01:59 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2009-02-19 14:01:59 +0000
commit7885988df9c4a7690424952d9e8557fc87f3ae18 (patch)
treef9dacb318cfad5bf07f303e957b43eaf34b2761e /gtk2_ardour/vst_pluginui.cc
parentef4e7d7b4c318de046cf91ec93dfbda3eb557bf0 (diff)
working VST support with VeSTige header and new FST code
git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@4637 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/vst_pluginui.cc')
-rw-r--r--gtk2_ardour/vst_pluginui.cc28
1 files changed, 28 insertions, 0 deletions
diff --git a/gtk2_ardour/vst_pluginui.cc b/gtk2_ardour/vst_pluginui.cc
index 6fee847123..6e39a0ba70 100644
--- a/gtk2_ardour/vst_pluginui.cc
+++ b/gtk2_ardour/vst_pluginui.cc
@@ -18,6 +18,7 @@
*/
#include <fst.h>
+#include <gtk/gtk.h>
#include <gtk/gtksocket.h>
#include <ardour/insert.h>
#include <ardour/vst_plugin.h>
@@ -76,6 +77,8 @@ VSTPluginUI::package (Gtk::Window& win)
socket.add_id (fst_get_XID (vst->fst()));
+ fst_move_window_into_view (vst->fst());
+
return 0;
}
@@ -118,3 +121,28 @@ VSTPluginUI::configure_handler (GdkEventConfigure* ev, Gtk::Socket *socket)
return false;
}
+typedef int (*error_handler_t)( Display *, XErrorEvent *);
+static Display *the_gtk_display;
+static error_handler_t wine_error_handler;
+static error_handler_t gtk_error_handler;
+
+static int
+fst_xerror_handler( Display *disp, XErrorEvent *ev )
+{
+ if (disp == the_gtk_display) {
+ printf ("relaying error to gtk\n");
+ return gtk_error_handler (disp, ev);
+ } else {
+ printf( "relaying error to wine\n" );
+ return wine_error_handler (disp, ev);
+ }
+}
+
+void
+gui_init (int *argc, char **argv[])
+{
+ wine_error_handler = XSetErrorHandler (NULL);
+ gtk_init (argc, argv);
+ the_gtk_display = gdk_x11_display_get_xdisplay (gdk_display_get_default());
+ gtk_error_handler = XSetErrorHandler( fst_xerror_handler );
+}