Repository navigation
fix(plugins): open Linux plugin editors in native X11 windows - #66
Merged
Merged
Conversation
4 of 7 tasks
|
Tested with build at commit 020ac18 Works with a VST3 plugin on
HiDPI: The plugin editor appears to render at 1× scale rather than following GNOME's display scaling. I'm not sure whether this is a host-side issue, a plugin limitation, or something I've missed. Splitwave/src-tauri/src/audio/plugins/clap_host.rs Lines 462 to 463 in 020ac18 |
Owner
Author
|
Fixed and checked on Fedora 44 with GNOME Wayland and HiDPI. The VST3 editor now opens at the right size |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Plugin editors now open on Linux without forcing the whole app onto XWayland.
VST3 and CLAP editors on Linux can only be parented into an X11 window. The editor window used to be a Tauri/GTK window. On a native Wayland session it has no X11 handle at all. On X11/XWayland it also failed, because the window was hidden and never realized, so GTK had not created the native window yet.
On Linux, editor windows are now plain X11 windows. They are created with
x11rbon our own connection to$DISPLAY, which on a Wayland session is XWayland. The main UI stays native Wayland; only plugin editors go through X11.editor_x11.rs: creates, shows, hides and destroys the X11 toplevel; sets the title (_NET_WM_NAME), min size (WM_NORMAL_HINTS) and close (WM_DELETE_WINDOW); scale isXft.dpi / 96.EditorWindowineditor.rswraps the platform window. macOS and Windows keeptauri::Windowwith no behaviour change.PluginHost::embed_editortakes&EditorWindow. CLAP, VST3 and AU are updated.CloseRequested.editor_x11.rsalso setsWM_CLASS, so the WM groups editors with the app; reopening an editor raises and activates it via_NET_ACTIVE_WINDOW; a dropped X connection is logged instead of silently stopping close handling.IPlugViewContentScaleSupport::setContentScaleFactor, set before the firstgetSize, like CLAP'sset_scale. Before this, VST3 editors on Linux rendered at 1x. Not called on macOS, where Cocoa scales itself.Why is this the right approach?
Alternatives considered and rejected:
GDK_BACKEND=x11.GDK_BACKEND=x11for the whole app: the entire UI goes through XWayland and gets blurry under fractional scaling.Plugins on Linux always open their own X connection, whatever host they run in. They only need the XID of the parent window, so which toolkit created that window makes no difference to them.
Dependency:
x11rb = "0.13", Linux only. GTK cannot create an X11 window on a Wayland session.x11rbwas already in the tree transitively, soCargo.lockgains one line and no new crates.Checklist
bun run checkpassescargo check --manifest-path src-tauri/Cargo.tomlpassesbun run formatleaves the tree cleanDspWorker::run. Everything runs on the main thread: editor open/close and the existing 16 ms plugin tickPlatform coverage
GDK_BACKENDoverridecargo check,bun run checkPer-OS files:
src-tauri/src/audio/plugins/editor_x11.rs(new, Linux only).editor.rshas#[cfg]branches per platform. On macOS and Windows the window is the sametauri::Windowas before.au_host.rs(macOS only) changes only the type and goes throughEditorWindow::tauri().Related