start handling plugin window keyboard focus (in-progress)
authorPaul Davis <paul@linuxaudiosystems.com>
Tue, 28 Oct 2008 00:24:56 +0000 (00:24 +0000)
committerPaul Davis <paul@linuxaudiosystems.com>
Tue, 28 Oct 2008 00:24:56 +0000 (00:24 +0000)
git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@4021 d708f5d6-7413-0410-9779-e7cbd77b26cf

gtk2_ardour/au_pluginui.mm
gtk2_ardour/utils.cc

index 977e5762a7363c75c8ed1ae347b2444350574627..d09a553c010b4a6f2ffb5d689fe1cf4be1911533 100644 (file)
@@ -618,6 +618,7 @@ bool
 AUPluginUI::on_focus_in_event (GdkEventFocus* ev)
 {
        cerr << "au plugin focus in\n";
+       Keyboard::magic_widget_grab_focus ();
        return false;
 }
 
@@ -625,6 +626,7 @@ bool
 AUPluginUI::on_focus_out_event (GdkEventFocus* ev)
 {
        cerr << "au plugin focus out\n";
+       Keyboard::magic_widget_drop_focus ();
        return false;
 }
 
index c5faef2b0cbe468161f5652e4bedd563904aebf3..ad75577c3f6ffaed72012e502ff15fd99804d123 100644 (file)
@@ -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