summaryrefslogtreecommitdiff
path: root/gtk2_ardour/vst_plugin_ui.cc
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2014-02-21 18:00:12 +0100
committerRobin Gareus <robin@gareus.org>2014-02-22 03:11:48 +0100
commitdfeb68aeb4cfb23b335e3a171314b78327d832e3 (patch)
tree0de9636e5cbf283c08e21b0da5eb0c8423ce8015 /gtk2_ardour/vst_plugin_ui.cc
parent40aa7e5e9034321f8af0b3067bd5f3005c537d5d (diff)
Windows VST GUI related rework
Diffstat (limited to 'gtk2_ardour/vst_plugin_ui.cc')
-rw-r--r--gtk2_ardour/vst_plugin_ui.cc12
1 files changed, 11 insertions, 1 deletions
diff --git a/gtk2_ardour/vst_plugin_ui.cc b/gtk2_ardour/vst_plugin_ui.cc
index be8eae3240..2bd9724b87 100644
--- a/gtk2_ardour/vst_plugin_ui.cc
+++ b/gtk2_ardour/vst_plugin_ui.cc
@@ -39,7 +39,9 @@ VSTPluginUI::VSTPluginUI (boost::shared_ptr<ARDOUR::PluginInsert> insert, boost:
bypass_button.set_active (!insert->active ());
pack_start (*box, false, false);
+#ifdef GDK_WINDOWING_X11
pack_start (_socket, true, true);
+#endif
}
VSTPluginUI::~VSTPluginUI ()
@@ -50,14 +52,18 @@ VSTPluginUI::~VSTPluginUI ()
void
VSTPluginUI::preset_selected ()
{
+#ifdef GDK_WINDOWING_X11
_socket.grab_focus ();
+#endif
PlugUIBase::preset_selected ();
}
int
VSTPluginUI::get_preferred_height ()
{
- return _vst->state()->height;
+ int preferred_height = _vst->state()->height;
+ preferred_height += _vst->state()->voffset;
+ return preferred_height;
}
int
@@ -69,11 +75,13 @@ VSTPluginUI::get_preferred_width ()
int
VSTPluginUI::package (Gtk::Window& win)
{
+#ifdef GDK_WINDOWING_X11
/* Forward configure events to plugin window */
win.signal_configure_event().connect (sigc::mem_fun (*this, &VSTPluginUI::configure_handler), false);
/* This assumes that the window's owner understands the XEmbed protocol */
_socket.add_id (get_XID ());
+#endif
return 0;
}
@@ -96,6 +104,7 @@ VSTPluginUI::on_window_hide()
bool
VSTPluginUI::configure_handler (GdkEventConfigure*)
{
+#ifdef GDK_WINDOWING_X11
XEvent event;
gint x, y;
GdkWindow* w;
@@ -129,6 +138,7 @@ VSTPluginUI::configure_handler (GdkEventConfigure*)
XSendEvent (GDK_WINDOW_XDISPLAY (w), GDK_WINDOW_XWINDOW (w), False, StructureNotifyMask, &event);
gdk_error_trap_pop ();
+#endif
return false;
}