minor safety check for symmetry
authorPaul Davis <paul@linuxaudiosystems.com>
Tue, 14 Dec 2010 20:28:11 +0000 (20:28 +0000)
committerPaul Davis <paul@linuxaudiosystems.com>
Tue, 14 Dec 2010 20:28:11 +0000 (20:28 +0000)
git-svn-id: svn://localhost/ardour2/branches/3.0@8276 d708f5d6-7413-0410-9779-e7cbd77b26cf

gtk2_ardour/plugin_ui.cc

index c51566614d10cdec812f32674f831118e9e829c0..d46f1e95423317ce70162819027867b82cf198df 100644 (file)
@@ -367,15 +367,23 @@ PluginUIWindow::on_key_press_event (GdkEventKey* event)
                }
                return true;
        } else {
-                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());
+                /* for us to be getting key press events, there really
+                   MUST be a _pluginui, but just to be safe, check ...
+                */
+
+                if (_pluginui) {
+                        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);
+                        }
                 } else {
-                        return relay_key_press (event, this);
+                        return false;
                 }
        }
 }