diff options
| author | 2026-11-21 16:54:05 +0100 | |
|---|---|---|
| committer | 2026-11-28 21:59:00 -0700 | |
| commit | 861cf929bc43105a522beb2db0b2b6bb2d56b890 (patch) | |
| tree | 06059b5075f3a62f2388f6b2fa53e05d005c6645 /WDL/swell/Makefile | |
| parent | swell-generic-wayland: add a native Wayland backend (diff) | |
| download | WDL-wayland-master.tar.xz WDL-wayland-master.zip | |
VST3 3.8 lets a plugin open a Wayland connection to its host and make
its editor a subsurface of the host window. Let's monkey patch it into
REAPER. This code would be best implemented inside of REAPER proper, but
REAPER is closed source. So this patch hijacks GetPluginFactory to carry
out its mischief.
Obviously much of this will be moved into REAPER proper; SWELL isn't
supposed to depend on the VST3 SDK at all, for example. So this commit
is mostly a proof of concept, and also has some of the compositor code
that will be useful later.
This works by giving plugins a private display and forwarding its
requests to our compositor connection, which lets the compositor use the
plugin's own buffers. We share the containing xdg surface and toplevel
too, so the plugin can parent menus and dialogs and such.
Unfortunately, since this is a hack, REAPER still asks for an X11
editor. When REAPER calls GetPluginFactory, we actually use the XID it
passes to attached() to find the corresponding SWELL window. This means
we still have Xwayland allocating these, but is unused on Wayland
plugins.
To build this, point VST3_SDK at the directory containing pluginterfaces
from the 3.8 SDK. This also needs libwayland-server and libffi.
make -C WDL/swell WAYLAND=1 VST3_SDK=/path/to/vst3sdk
Diffstat (limited to 'WDL/swell/Makefile')
| -rw-r--r-- | WDL/swell/Makefile | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/WDL/swell/Makefile b/WDL/swell/Makefile index a879f6b7..cb5ed336 100644 --- a/WDL/swell/Makefile +++ b/WDL/swell/Makefile @@ -125,12 +125,18 @@ ifndef NOGDK cairo libdecor-0 epoxy egl xcb-keysyms xcb-randr xcb-damage \ xcb-shape xcb-shm xcb-dri3 xcb-sync xcb-composite xcb-ewmh xcb-xtest \ xcb-xfixes xcb-xkb xcb-image xcb-renderutil xcb-res libdrm + WAYLAND_PROTOCOLS := xdg-shell text-input-unstable-v3 xdg-activation-v1 xdg-toplevel-drag-v1 viewporter fractional-scale-v1 xdg-output-unstable-v1 cursor-shape-v1 pointer-warp-v1 tablet-unstable-v2 + ifdef VST3_SDK + WAYLAND_PACKAGES += 'wayland-server >= 1.22' libffi + WAYLAND_PROTOCOLS += linux-dmabuf-v1 linux-drm-syncobj-v1 + CFLAGS += -DSWELL_WAYLAND_VST3 + SWELL_OBJS += swell-vst3-wayland.o swell-wayland-delegate.o + endif CFLAGS += -DSWELL_TARGET_WAYLAND $(shell $(PKG_CONFIG) --cflags $(WAYLAND_PACKAGES)) LINKEXTRA += $(shell $(PKG_CONFIG) --libs $(WAYLAND_PACKAGES)) SWELL_OBJS += swell-generic-wayland.o swell-xwayland-bridge.o WAYLAND_SCANNER ?= wayland-scanner WAYLAND_PROTOCOLS_DIR := $(shell $(PKG_CONFIG) --variable=pkgdatadir wayland-protocols) - WAYLAND_PROTOCOLS := xdg-shell text-input-unstable-v3 xdg-activation-v1 xdg-toplevel-drag-v1 viewporter fractional-scale-v1 xdg-output-unstable-v1 cursor-shape-v1 pointer-warp-v1 tablet-unstable-v2 SWELL_OBJS += $(addsuffix -protocol.o,$(WAYLAND_PROTOCOLS)) endif ifndef SWELL_GDK_ONLY @@ -205,8 +211,14 @@ clean: ifdef WAYLAND ifndef NOGDK ifndef GDK2 -swell-generic-wayland.o swell-xwayland-bridge.o: CXXFLAGS += -std=c++17 -swell-generic-wayland.o swell-xwayland-bridge.o: $(SWELL_HEADERS) swell-wayland.h swell-xwayland-bridge.h $(addsuffix -client-protocol.h,$(WAYLAND_PROTOCOLS)) +ifdef VST3_SDK +swell-vst3-wayland.o: CXXFLAGS += -isystem "$(VST3_SDK)" +swell.o swell-generic-wayland.o swell-xwayland-bridge.o swell-vst3-wayland.o swell-wayland-delegate.o: swell-vst3-wayland.h +endif +swell-generic-wayland.o swell-xwayland-bridge.o swell-vst3-wayland.o swell-wayland-delegate.o: CXXFLAGS += -std=c++17 +swell-generic-wayland.o swell-xwayland-bridge.o swell-vst3-wayland.o swell-wayland-delegate.o: $(SWELL_HEADERS) swell-wayland.h swell-xwayland-bridge.h $(addsuffix -client-protocol.h,$(WAYLAND_PROTOCOLS)) +linux-dmabuf-v1-client-protocol.h linux-dmabuf-v1-protocol.c: $(WAYLAND_PROTOCOLS_DIR)/stable/linux-dmabuf/linux-dmabuf-v1.xml +linux-drm-syncobj-v1-client-protocol.h linux-drm-syncobj-v1-protocol.c: $(WAYLAND_PROTOCOLS_DIR)/staging/linux-drm-syncobj/linux-drm-syncobj-v1.xml xdg-shell-client-protocol.h xdg-shell-protocol.c: $(WAYLAND_PROTOCOLS_DIR)/stable/xdg-shell/xdg-shell.xml text-input-unstable-v3-client-protocol.h text-input-unstable-v3-protocol.c: $(WAYLAND_PROTOCOLS_DIR)/unstable/text-input/text-input-unstable-v3.xml xdg-activation-v1-client-protocol.h xdg-activation-v1-protocol.c: $(WAYLAND_PROTOCOLS_DIR)/staging/xdg-activation/xdg-activation-v1.xml |
