diff options
author | Robin Gareus <robin@gareus.org> | 2015-02-21 03:16:04 +0100 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2015-02-21 03:16:04 +0100 |
commit | a0eeb808850f9b39bd1b5526d70634a75a0a9701 (patch) | |
tree | b37b1991302cc69bda8487e385a4aa3418009391 /gtk2_ardour/lv2_plugin_ui.cc | |
parent | 642e4950b915a2317bd51e3ec7c270909229c353 (diff) |
fix embedded plugin UI keyboard handling
When the GUI is opened the first time all is fine, focus is on the
embedded widget. However once a user presses one of the preset buttons
(Add, Save,...) there is no possibility to return focus to the
embedded widget. Ardour always 'sees' it as focus=GtkButton and passes
the event to the editor.
Diffstat (limited to 'gtk2_ardour/lv2_plugin_ui.cc')
-rw-r--r-- | gtk2_ardour/lv2_plugin_ui.cc | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/gtk2_ardour/lv2_plugin_ui.cc b/gtk2_ardour/lv2_plugin_ui.cc index 3a64a830d1..8e57eeed60 100644 --- a/gtk2_ardour/lv2_plugin_ui.cc +++ b/gtk2_ardour/lv2_plugin_ui.cc @@ -341,6 +341,8 @@ LV2PluginUI::lv2ui_instantiate(const std::string& title) container->add(*Gtk::manage(Glib::wrap(c_widget))); } container->show_all(); + gtk_widget_set_can_focus(c_widget, true); + gtk_widget_grab_focus(c_widget); } else { _external_ui_ptr = (struct lv2_external_ui*)GET_WIDGET(_inst); } @@ -369,6 +371,15 @@ LV2PluginUI::lv2ui_instantiate(const std::string& title) } void +LV2PluginUI::grab_focus() +{ + if (_inst && !_lv2->is_external_ui()) { + GtkWidget* c_widget = (GtkWidget*)GET_WIDGET(_inst); + gtk_widget_grab_focus(c_widget); + } +} + +void LV2PluginUI::lv2ui_free() { stop_updating (0); |