From 7e0c6ab7ad5767356a12e3b05659f7218a915d40 Mon Sep 17 00:00:00 2001 From: paul Date: Mon, 7 Jun 2010 19:31:04 +0000 Subject: [PATCH] try to fix mistake introduced in 7207 that stole key events from GTK plugin GUIs git-svn-id: http://subversion.ardour.org/svn/ardour2/ardour2/branches/2.0-ongoing@7239 d708f5d6-7413-0410-9779-e7cbd77b26cf --- gtk2_ardour/au_pluginui.h | 2 ++ gtk2_ardour/plugin_ui.cc | 21 ++++++++++++--------- gtk2_ardour/plugin_ui.h | 3 +++ 3 files changed, 17 insertions(+), 9 deletions(-) diff --git a/gtk2_ardour/au_pluginui.h b/gtk2_ardour/au_pluginui.h index 429f768fb..cb4b88ee3 100644 --- a/gtk2_ardour/au_pluginui.h +++ b/gtk2_ardour/au_pluginui.h @@ -55,6 +55,8 @@ class AUPluginUI : public PlugUIBase, public Gtk::VBox bool on_window_show (const Glib::ustring&); void on_window_hide (); + bool non_gtk_gui() const { return true; } + void lower_box_realized (); void cocoa_view_resized (); void on_realize (); diff --git a/gtk2_ardour/plugin_ui.cc b/gtk2_ardour/plugin_ui.cc index 0957ef0ba..e8bde421e 100644 --- a/gtk2_ardour/plugin_ui.cc +++ b/gtk2_ardour/plugin_ui.cc @@ -69,10 +69,11 @@ using namespace sigc; PluginUIWindow::PluginUIWindow (Gtk::Window* win, boost::shared_ptr insert, bool scrollable) : parent (win) + , was_visible (false) + , _keyboard_focused (false) { bool have_gui = false; was_visible = false; - _keyboard_focused = false; if (insert->plugin()->has_editor()) { switch (insert->type()) { @@ -248,7 +249,6 @@ PluginUIWindow::create_vst_editor(boost::shared_ptr insert) add (*vpu); vpu->package (*this); } - return true; #endif } @@ -329,13 +329,16 @@ PluginUIWindow::on_key_press_event (GdkEventKey* event) } return true; } else { - /* pass editor window as the window for the event - to be handled in, not this one, because there are - no widgets in this window that we want to have - key focus. - */ - - return relay_key_press (event, &PublicEditor::instance()); + if (_pluginui->non_gtk_gui()) { + /* pass editor window as the window for the event + to be handled in, not this one, because there are + no widgets in this window that we want to have + key focus. + */ + return relay_key_press (event, &PublicEditor::instance()); + } else { + return relay_key_press (event, this); + } } } diff --git a/gtk2_ardour/plugin_ui.h b/gtk2_ardour/plugin_ui.h index be328f5e5..672770784 100644 --- a/gtk2_ardour/plugin_ui.h +++ b/gtk2_ardour/plugin_ui.h @@ -86,6 +86,8 @@ class PlugUIBase : public virtual sigc::trackable virtual void on_window_hide() {} virtual void forward_key_event (GdkEventKey*) {} + virtual bool non_gtk_gui() const { return false; } + sigc::signal KeyboardFocused; @@ -270,6 +272,7 @@ class VSTPluginUI : public PlugUIBase, public Gtk::VBox bool stop_updating(GdkEventAny*) {return false;} int package (Gtk::Window&); + bool non_gtk_gui() const { return true; } private: boost::shared_ptr vst; -- 2.11.4.GIT