Skip to content

X11: remove Send requirement and process all UI and events on the main thread #342

Description

@prokopyl

Currently the X11 backend spawns a new thread in order to spawn its own event loop and processes everything there.
This is done because on Linux there is no such thing as a global event loop (unlike Windows and macOS), so there is no standardized event loop for us to plug into.

The issue is that this forces a Send bound on the WindowHandler, which is only necessary for this workaround to work(Windows and macOS always keep everything on the main thread).

VST3 and CLAP now have support for either timer, or more ideally for watching any File Descriptor, and have the host call us back when any new event arrives on those. This allows us to indirectly plug into the host's event loop without blocking anything, and is how most (if not all?) plugins work in those formats.

We should augment the Host API to support timer and FD extensions, which would allow us to drop the Send bound and simplify quite a bit of code on the baseview side.

This however is a breaking change, not because of dropping the Send requirement, but because it will require all users to implement the new Host API.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions