summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2010-06-07 19:31:04 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2010-06-07 19:31:04 +0000
commit78cbf1cb9ad03f5e3150cbd3533f493c1a0711ab (patch)
tree0a184d3c4220c534ab2406f935fd95ecfc9aa961
parentf9a47cff2b7f07b769fe674f395e413fc40501fe (diff)
try to fix mistake introduced in 7207 that stole key events from GTK plugin GUIs
git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@7239 d708f5d6-7413-0410-9779-e7cbd77b26cf
-rw-r--r--gtk2_ardour/au_pluginui.h2
-rw-r--r--gtk2_ardour/plugin_ui.cc21
-rw-r--r--gtk2_ardour/plugin_ui.h3
3 files changed, 17 insertions, 9 deletions
diff --git a/gtk2_ardour/au_pluginui.h b/gtk2_ardour/au_pluginui.h
index 429f768fb0..cb4b88ee39 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 0957ef0bad..e8bde421e9 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<PluginInsert> 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<PluginInsert> 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 be328f5e55..6727707846 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<void,bool> 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<ARDOUR::VSTPlugin> vst;