Commit Graph

1618 Commits

Author SHA1 Message Date
Robbert van der Helm c18332f7d4 Revert back to the detached Konsole window winedbg
This works again, and it's a bit less of a pain than connecting to
gdbserver.
2021-10-02 15:05:59 +02:00
Robbert van der Helm f4a5754eae Quote winedbg arguments instead of using start dir
Apparently these arguments are all passed as a space separated Win32
command line, so we need to do our own quoting. I was about to submit a
patch for this to Wine, but escaping escaped quotes sounds like a pain.
2021-10-02 15:04:34 +02:00
Robbert van der Helm 46b4dc0341 Add missing includes for Boost 1.77 2021-09-27 17:45:59 +02:00
Robbert van der Helm fc19bf74da Comment about performance in bus cache lookups 2021-09-27 17:45:58 +02:00
Robbert van der Helm 9d9eac85ef Store context menu items in unordered maps
The difference in performance won't be noticable, but both lookups and
modifications in these things are much faster once you have more than
one or two elements.
2021-09-27 17:36:48 +02:00
Robbert van der Helm 4bf7e8a5a2 Remove unnecessary iostream import
I was going to add a warning to the last commit, but I ended up not
doing it because we should be printing those to the logger instead.
2021-09-26 19:54:56 +02:00
Robbert van der Helm 5aa25109b8 Work around Boost.Process invalid locale bug/crash
This should not be causing any issues, but it seems like some people
skip the locale setup step in the Arch installation guide and then end
up with a distro without any locales, with invalid locales, or with a
non-generated locale. glibc and libstd++ fall back to the C locale when
this happens, but Boost.Process triggers one of the edge cases where
this doesn't happen. https://github.com/boostorg/process/pull/179 fixes
this in Boost.Process, but it will be a while until this is in every
distro's copy of Boost.

https://svn.boost.org/trac10/changeset/72855
2021-09-26 19:25:35 +02:00
Robbert van der Helm 3dd5859799 Always print version information in plugin hosts
When the plugin host applications are invoked without arguments. Seems a
bit weird when they only print this when invoked with arguments.
2021-09-26 18:20:20 +02:00
Robbert van der Helm 0c9c4686f1 Use the small buffer optimization for VST3 SysEx
We apparently didn't do that yet. SysEx should be super rare (outside of
octave switching on Arturia keyboards), but there's still no reason not
to do it.
2021-09-23 14:29:12 +02:00
Robbert van der Helm 3950f055ad Fix wording in new warning messages 2021-09-21 15:54:19 +02:00
Robbert van der Helm 7760c4bb6c Show desktop notification for low RLIMIT_RTTIME
For the same reason as the last commit, since people otherwise just miss
this.
2021-09-21 15:40:32 +02:00
Robbert van der Helm e347944e38 Show desktop notification for the memlock warning
Since most people don't try running things in a terminal.
2021-09-21 15:32:47 +02:00
Robbert van der Helm f26a2a2689 Set VST2 SR and block sizes from main thread
This apparently fixes New Sonic Arts' Vice plugin freezing while
loading. Hopefully this doesn't cause issues with other plugins. Spotted
in https://www.kvraudio.com/forum/viewtopic.php?p=8217647#p8217647.
2021-09-21 14:11:15 +02:00
Robbert van der Helm ec41ec1c81 Add a warmup phase to the XDND implementation
This fixes short drops being ignored. Bitwig does this, and I've also
seen some Qt applications do this.
2021-08-22 16:43:02 +02:00
Robbert van der Helm 64f0cbcd41 Fix property reply errors being coerced to 0
During a refactor this changed from a boolean to an option, guess I
missed this.
2021-08-22 16:41:40 +02:00
Robbert van der Helm c12c1459bb Fix drag-and-drop skipping the first tick
This check is of course not supposed to be here.
2021-08-22 15:56:23 +02:00
Robbert van der Helm 5bf3b97118 Hide symbols in VST3 static libraries
I noticed a couple of UID/string conversion related symbols showing up
in the text section.
2021-08-17 15:50:08 +02:00
Robbert van der Helm c1b4410e6b Don't include angular brackets for concrete types
In the VST2 log output. I just use this syntax as a more descriptive
handwavy substitute for the actual data.
2021-08-17 15:15:33 +02:00
Robbert van der Helm f55a04a1fc Fix VST2 logging message for effEditGetRect() 2021-08-17 15:12:08 +02:00
Robbert van der Helm 5613248cda Gate the new resizing behavior behind new option
This interferes with resizing plugins using resize handles, and since it
only helps with two buggy plugins this seems like the best solution
here.
2021-08-16 22:39:13 +02:00
Robbert van der Helm b84aa18ecf Only reset coordinates when resizing
This was the original idea. I though that to be extra safe, maybe we can
do this all the time. And while that does work fine, most of the time,
it does cause a lot of other fun issues especially when plugins fully
redraw themselves that way.
2021-08-16 21:31:57 +02:00
Robbert van der Helm cc9226a3fc Remove editor_double_embed
It's no longer needed after the `fix_local_coordinates()` change from a
fa12c64866a8b79e862bc5db4c4b092a4b762689.
2021-08-16 21:21:57 +02:00
Robbert van der Helm 9ac597a6fd Make the resize function not-noexcept
Since technically the string allocations within the logging for
`fix_local_coordinates()` can throw.
2021-08-16 21:21:57 +02:00
Robbert van der Helm d46f7882bd Reposition to (0, 0) while fixing coordinates
The goal is to have the window be at (0, 0), while Wine's X11 event
layer thinks it is at the actual screen coordinates. This is needed to
prevent drawing issues with buggy plugins that rely on absolute screen
coordinates to draw their GUI.
2021-08-16 21:21:57 +02:00
Robbert van der Helm 6fab25cabf Remove unnecessary early return 2021-08-16 21:21:57 +02:00
Robbert van der Helm e6f0fe16d8 Target VST3 SDK version 3.7.3 2021-08-10 17:14:48 +02:00
Robbert van der Helm 1883888ec6 Unify exception handling style 2021-08-07 13:17:03 +02:00
Robbert van der Helm 9160de6483 Implement VST2 SysEx events
Apparently these _are_ actually used. Sometimes.
2021-08-04 21:40:09 +02:00
Robbert van der Helm dceafd3016 Use constexpr for VeSTige
It won't actually change anything, but since we're changing the header
anyways might as well change this too.
2021-08-04 21:17:05 +02:00
Robbert van der Helm 387e23d7ec Include types for VST2 SysEx messages
Apparently there is a copy of the VeSTige headers that includes this.
Taken from:

https://github.com/x42/lv2vst/blob/30a669a021812da05258519cef9d4202f5ce26c3/include/vestige.h
2021-08-04 21:16:03 +02:00
Robbert van der Helm 2e6732c0e2 Fix regression for VST3 editor initial sizing
We accidentally reverted a little bit too much code in
762e622416. This didn't appear any sooner
because plugins are supposed to call `IPlugFrame::resizeView()` during
`IPlugView::attached()`, so this only affects plugins that don't confirm
to the spec.
2021-08-02 14:47:21 +02:00
Robbert van der Helm e430c5f015 Directly focus wine_window while holding Shift
This lets you type spaces in Bitwig, and it also allows you to interact
with the settings/license popup dialogs in Voxengo plugins in a normal
way.
2021-07-31 16:31:53 +02:00
Robbert van der Helm bf59e5e8ce Also grab keyboard focus on parent window focus
This allows you to directly focus plugin GUIs that are open in the
background in REAPER.
2021-07-31 16:14:02 +02:00
Robbert van der Helm be6fc786ca Add a function for getting the active modifiers 2021-07-31 15:49:47 +02:00
Robbert van der Helm c98a9519fe Handle X11 events within the Win32 event loop
This unifies event handling and it allows X11 events to still be
processed even when the event loop is blocked.
2021-07-31 15:19:44 +02:00
Robbert van der Helm 762e622416 Revert "Inhibit the event loop during VST3 editor init"
This reverts commit ff76e482f2.

This was a workaround for a race condition in Nimble Kick when opening
the editor while the plugin has not yet been authorized (a Win32 timer
proc between `IEditController::createView()` and `IPlugView::attached()`
would cause a stack overflow because the plugin doesn't check if the
things it wants to use have actually been initialized yet).

But as it turns out, Bitwig Studio now calls
`IEditController::createView()` unconditionally when loading a VST3
plugin, regardless of whether the user wants to open the editor or not.
So this workaround would cause the message loop to be stalled
indefinitely until you open the editor. Since this would also cause
Nimble Kick to break in the Windows version of Bitwig, we'll simply
revert this workaround. If you need to activate the plugin on Linux, you
can load it in the Windows version of REAPER running under Wine instead.
After that the plugin will work just fine under yabridge.
2021-07-29 13:56:26 +02:00
Robbert van der Helm d053eab35a Filter LeaveNotify based on window under pointer
Instead of ignoring all `NonlinearVirtual` events. This lets us release
focus when instantly moving the mouse from a plugin GUI to something
else. This generates `NonlinearVirtual` event, and previously we ignored
those because that also happens when opening a dropdown menu in a TDR
plugin (which uses popup windows instead of actual dropdowns).
2021-07-27 18:05:47 +02:00
Robbert van der Helm e42448f758 Allow manual position for is_cursor_in_wine_window
We'll need this for the `LeaveNotify` because `GetCursorPos()` updates
only once every 100 ms, which means that it would still point to the old
window we're actually leaving.
2021-07-26 15:08:23 +02:00
Robbert van der Helm e1ed35bfd8 Don't respond to hit tests from the Win32 window
This will let us detect other, non-wrapper windows to the right and to
the bottom of a plugin GUI. Useful for drag-and-drop so we don't end up
overriding Wine's internal drag-and-drop mechanism.
2021-07-26 14:44:23 +02:00
Robbert van der Helm 186a6c01a2 Filter Win32 windows for XDND by class name
Instead of ignoring all windows that have an associated X11 window. That
would otherwise treat standalone applications like yabridge GUI
wrappers.
2021-07-26 14:29:06 +02:00
Robbert van der Helm 85264a759d Move check for cursor within Wine window to editor
We'll reuse this for the LeaveNotify check instead to avoid having to
ignore all `NonVirtual` events.
2021-07-26 14:01:16 +02:00
Robbert van der Helm 0523a06ed7 Move the win32 window class name to a constant 2021-07-26 13:51:40 +02:00
Robbert van der Helm d522e57a8a Add active window to enter/leave/focus tracing 2021-07-26 12:43:32 +02:00
Robbert van der Helm 890c534573 Trace input focus grabbing 2021-07-26 12:38:17 +02:00
Robbert van der Helm 7b05e038c3 Reword memlock warning message 2021-07-23 15:59:13 +02:00
Robbert van der Helm 5c3491c1e1 Use exception logger for the memory locking error 2021-07-23 15:53:19 +02:00
Robbert van der Helm 1a34a80c21 Add a special exception logger
We'll need this to make sure that we can redirect caught exceptions
printed in `src/common/` to the correct file if `YABRIDGE_DEBUG_FILE` is
set.
2021-07-23 15:46:08 +02:00
Robbert van der Helm 4d2ee96167 Remove old TODO about +editor debug level 2021-07-23 15:22:45 +02:00
Robbert van der Helm 7a2febfffb Support the older XDND versions 3 and 4
This is needed for Tracktion Waveform and other JUCE based hosts.
2021-07-23 13:19:10 +02:00
Robbert van der Helm 9e84352609 Fix typo in XDND code 2021-07-23 12:45:53 +02:00