Based on a function. This is needed because the message loop should be
skipped while any of the plugins is opening their GUI, similar to how
`EditorOpening` worked for individually hosted plugins.
With this the plugin groups functionality is feature complete, although
I still want to do a few rounds of refactoring and the readme has not
yet been updated.
Handles for things like timers should be unique on a per-thread basis in
the Win32 API, but apparently window classes have to be unique for the
entire application.
This allows for a significant speedup in plugin scanning time for plugin
groups, since starting Wine processes takes up pretty much the entirety
of the time spent scanning plugins.
This was not a problem with individually hosted plugins because the
entire process got terminated at once, but here we all threads to shut
down gracefully when a plugin's sockets get closed. I wish this wouldn't
need all these try-catches, but we're not writing Haskell here.
The only issue remaining is that for some reason only the first
instance's editor works, at least for Serum. This might be because of
the message loop.
In case two yabridge instances start at the same time and both try to
launch a group host for the same group and the second plugin connects to
the first group host, then we should of course be using that process'es
PID to check if the group host is still running.
To prevent a race condition when an exiting plugin wants to terminate
the process when it think there are no plugins left just as another
yabridge instance is connecting to the group socket.
This will also cause the 64-bit version of the library to be picked up
on any distro that's not based on Fedora, which may cause some confusing
problems.
Is there a right way to do this? Meson doesn't allow you to override the
library search path for part of the build, and it also can't
differentiate between 32-bit and 64-bit libraries by default.
This reverts commit e728dbe5a2.
`std::filesystem` is broken on wineg++, at least with Wine 5.8. Any path
operations will throw a `std::filesystem::__cxx11::filesystem_error`:
what(): filesystem error: Cannot convert character sequence: Invalid or incomplete multibyte or wide character