void lower_box_realized ();
void cocoa_view_resized ();
void on_realize ();
+ void grab_focus();
void forward_key_event (GdkEventKey*);
bool on_window_show (const std::string& /*title*/);
return 0;
}
+void
+AUPluginUI::grab_focus()
+{
+ if (au_view) {
+ [au_view becomeFirstResponder];
+ }
+}
void
AUPluginUI::forward_key_event (GdkEventKey* ev)
{
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);
}
}
}
+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()
{
bool stop_updating(GdkEventAny*);
int package (Gtk::Window&);
+ void grab_focus ();
private:
{
if (_keyboard_focused) {
if (_pluginui) {
+ _pluginui->grab_focus();
if (_pluginui->non_gtk_gui()) {
_pluginui->forward_key_event (event);
} else {
*/
if (_pluginui) {
+ _pluginui->grab_focus();
if (_pluginui->non_gtk_gui()) {
/* pass editor window as the window for the event
to be handled in, not this one, because there are
virtual void on_window_hide() {}
virtual void forward_key_event (GdkEventKey*) {}
- virtual bool non_gtk_gui() const { return false; }
+ virtual void grab_focus () {}
+ virtual bool non_gtk_gui() const { return false; }
sigc::signal<void,bool> KeyboardFocused;