13
0

Prefer key-event dispatch over emulated events for VST plugins.

This commit is contained in:
Robin Gareus 2018-11-01 19:14:25 +01:00
parent 197f5460df
commit 3b1d9193ba
2 changed files with 8 additions and 3 deletions

View File

@ -141,10 +141,10 @@ LXVSTPluginUI::forward_key_event (GdkEventKey* gdk_key)
xev.xany.send_event = true; /* pretend we are using XSendEvent */
xev.xany.display = GDK_WINDOW_XDISPLAY (gdk_window->gobj());
if (!_vst->state()->eventProc) {
XSendEvent (xev.xany.display, xev.xany.window, TRUE, mask, &xev);
} else {
if (_vst->state()->eventProc) {
_vst->state()->eventProc (&xev);
} else if (!dispatch_effeditkey (gdk_key)) {
XSendEvent (xev.xany.display, xev.xany.window, TRUE, mask, &xev);
}
}

View File

@ -114,6 +114,10 @@ WindowsVSTPluginUI::package (Gtk::Window& win)
void
WindowsVSTPluginUI::forward_key_event (GdkEventKey* ev)
{
if (dispatch_effeditkey (ev)) {
return;
}
#ifndef PLATFORM_WINDOWS /* linux + wine ; libs/fst/vstwin.c */
if (ev->type != GDK_KEY_PRESS) {
return;
}
@ -156,6 +160,7 @@ WindowsVSTPluginUI::forward_key_event (GdkEventKey* ev)
fst->n_pending_keys++;
pthread_mutex_unlock (&fst->lock);
#endif
}
int