From e7cebfb6c5807c84abe972523575af35b0f8607d Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Tue, 28 Oct 2008 00:24:56 +0000 Subject: start handling plugin window keyboard focus (in-progress) git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@4021 d708f5d6-7413-0410-9779-e7cbd77b26cf --- gtk2_ardour/utils.cc | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'gtk2_ardour/utils.cc') diff --git a/gtk2_ardour/utils.cc b/gtk2_ardour/utils.cc index c5faef2b0c..ad75577c3f 100644 --- a/gtk2_ardour/utils.cc +++ b/gtk2_ardour/utils.cc @@ -408,6 +408,9 @@ key_press_focus_accelerator_handler (Gtk::Window& window, GdkEventKey* ev) GtkWindow* win = window.gobj(); GtkWidget* focus = gtk_window_get_focus (win); bool special_handling_of_unmodified_accelerators = false; +#ifdef GTKOSX + bool allow_forwarding = true; +#endif #undef DEBUG_ACCELERATOR_HANDLING #ifdef DEBUG_ACCELERATOR_HANDLING @@ -419,6 +422,12 @@ key_press_focus_accelerator_handler (Gtk::Window& window, GdkEventKey* ev) } } +#ifdef GTKOSX + if (Keyboard::some_magic_widget_has_focus ()) { + allow_forwarding = false; + } +#endif + #ifdef DEBUG_ACCELERATOR_HANDLING if (debug) { cerr << "Win = " << win << " Key event: code = " << ev->keyval << " state = " << hex << ev->state << dec << " special handling ? " @@ -497,8 +506,9 @@ key_press_focus_accelerator_handler (Gtk::Window& window, GdkEventKey* ev) cerr << "\tactivate, then propagate\n"; } #endif + #ifdef GTKOSX - if (gdk_quartz_possibly_forward ((GdkEvent*) ev)) { + if (allow_forwarding && gdk_quartz_possibly_forward ((GdkEvent*) ev)) { return true; } #endif -- cgit v1.2.3