Fix key-forwarding to linuxVST UIs
authorRobin Gareus <robin@gareus.org>
Thu, 1 Nov 2018 00:27:30 +0000 (01:27 +0100)
committerRobin Gareus <robin@gareus.org>
Thu, 1 Nov 2018 00:27:30 +0000 (01:27 +0100)
Tested with VeeSeeVST

gtk2_ardour/lxvst_plugin_ui.cc

index 25ee0f2aea5eefecdbed3e7529c63c836bee3d6a..baad5722ad17cc09f265719e53bd34580ff17c16 100644 (file)
@@ -116,7 +116,7 @@ LXVSTPluginUI::forward_key_event (GdkEventKey* gdk_key)
                mask = KeyPressMask;
                break;
        case GDK_KEY_RELEASE:
-               xev.xany.type = KeyPress;
+               xev.xany.type = KeyRelease;
                mask = KeyReleaseMask;
                break;
        default:
@@ -133,14 +133,13 @@ LXVSTPluginUI::forward_key_event (GdkEventKey* gdk_key)
        xev.xkey.x_root = 0;
        xev.xkey.y_root = 0;
        xev.xkey.root = gdk_x11_get_default_root_xwindow();
-       xev.xkey.window = _vst->state()->xid;
+       xev.xkey.window = _vst->state()->linux_plugin_ui_window ? _vst->state()->linux_plugin_ui_window : _vst->state()->xid;
        xev.xkey.subwindow = None;
        xev.xkey.time = gdk_key->time;
 
        xev.xany.serial = 0; /* we don't have one */
        xev.xany.send_event = true; /* pretend we are using XSendEvent */
        xev.xany.display = GDK_WINDOW_XDISPLAY (gdk_window->gobj());
-       xev.xany.window = _vst->state()->xid;
 
        if (!_vst->state()->eventProc) {
                XSendEvent (xev.xany.display, xev.xany.window, TRUE, mask, &xev);