diff --git a/README.md b/README.md index 8b1dbbcc..a03b82fc 100644 --- a/README.md +++ b/README.md @@ -13,8 +13,6 @@ There are a few things that should be done before releasing this, including: ideal. - Fix implementation bugs: - KiloHearts plugins fail during initialization. - - Serum (and probably other plugins too) can't process midi events while dialogs - are open. - Serum crashes when closing bitwig (but otherwise exits just fine). - Serum crashes if you keep playing midi notes while the GUI is blocked. Related to the above, and probably because of the current limit of 512 midi @@ -141,6 +139,19 @@ window managers will require some slight modifications in meson configure build --buildtype=debug -Duse-winedbg=true ``` +## Known issues + +- Plugins can't receive MIDI events while they have an open dropdown menu. This + is a limitation of the Win32 API which requires all GUI interaction to be done + from a single thread. Dropdowns and similar GUI elements are implemented in + such a way that they will block the thread until the user selects an item. + Most plugins will make the assumption that the GUI thread is the same thread + on which the plugin was created and also that this is also the same thread + from which `dispatch()` calls are being sent. Because of these limitations we + can't just move all GUI interaction to a different thread. A decent solution + for this would be to just create another pair of sockets and threads to + specifically handle the `effProcessEvents` opcode. + ## Rationale I started this project because the alternatives were either unmaintained, not diff --git a/src/wine-host/editor.cpp b/src/wine-host/editor.cpp index 15714007..d0b73d22 100644 --- a/src/wine-host/editor.cpp +++ b/src/wine-host/editor.cpp @@ -98,6 +98,8 @@ bool Editor::embed_into(const size_t parent_window_handle) { xcb_map_window(x11_connection.get(), child_window_handle); xcb_flush(x11_connection.get()); + // TODO: Add a timer after adding a seperate thread for midi events so that + // the GUI can redraw even while dropdowns are open. ShowWindow(win32_handle->get(), SW_SHOWNORMAL); return true; @@ -152,7 +154,6 @@ ATOM register_window_class(std::string window_class_name) { window_class.cbSize = sizeof(WNDCLASSEX); window_class.style = CS_DBLCLKS | CS_HREDRAW | CS_VREDRAW; - // TODO: Probably do something here to handle resizes window_class.lpfnWndProc = DefWindowProc; window_class.hInstance = GetModuleHandle(nullptr); window_class.hCursor = LoadCursor(nullptr, IDC_ARROW);