Repository navigation
fix(plugins): realize the Linux editor window before embedding - #61
ushiocheng wants to merge 1 commit into
Conversation
The editor window is built hidden, and GTK only creates the native window on realize, so window_handle() returned "the underlying window handle is not available" and no plugin editor could open on Linux. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Thanks a lot for digging into this, and for the very clear write-up. The root cause analysis was spot on: the hidden window was never realized, so tao had no The catch is that it only works when the whole app runs on XWayland. On a native Wayland session GTK has no X11 window at all, so there is nothing to realize, and asking every user to launch with So I went a different way in #66: on Linux, editor windows are no longer GTK windows but plain X11 windows created with I'm going to close this one in favour of #66. If you get a chance to try it on your Debian/GNOME setup, especially with a native Wayland session and a CLAP plugin, that would be really helpful. |
|
No hard feelings. I like the tool and found a way to get it running on my machine. Appreciate your work. |
What does this PR do?
Makes plugin editors open on Linux. In 1.4.0, pressing "Open editor" fails with:
editor::openbuilds the host window with.visible(false)and then hands it toembed_editor, which callswindow_handle(). On Linux, tao returnsHandleError::Unavailablewhenever the GTK window has noGdkWindow, and GTK onlycreates that on realize, which a never-shown window has not been through. The
error is raised before the X11/Wayland check, so it also happens under XWayland.
The fix realizes the GTK window right after it is created, on Linux only, so the
native window exists by the time a plugin view is parented into it. If the GTK
window cannot be fetched, the editor window is closed and the error is returned.
Why is this the right approach?
Realizing creates the native window without mapping it, so the existing
hidden-until-embedded behaviour is kept: the window still appears only once the
plugin view is attached and sized.
Alternative considered: building the window visible on Linux. That works without
new code, but shows an empty fallback-sized window before the embed and flashes
one on a failed embed, which the current code deliberately avoids.
New dependency:
gtk = "0.18", Linux-only. It is needed forWidgetExt::realizeon the window tauri returns from
gtk_window(). It is the samegtk 0.18.2thattauri, tao and webkit2gtk already link, so
Cargo.lockgains one line and no newcrates, versions or features. It does not enter the Windows or macOS dependency
graph.
Checklist
bun run checkpasses — not run; no frontend files are touchedcargo check --manifest-path src-tauri/Cargo.tomlpasses — not run locally;a full
tauri build --bundles debpassed on ubuntu-22.04 in my fork's CIbun run formatleaves the tree clean — not run;rustfmt --checkwith therepo's
rustfmt.tomlis clean on the changed fileDspWorker::run; it runson the main thread when an editor window is opened
Platform coverage
GDK_BACKEND=x11)it over 1.4.0, routed System Audio through a VST3 plugin to a speaker, started
the pipeline and pressed "Open editor". Before: the error above. After: the
editor window opens and renders.
CLAP editors on Linux (same code path, but I had no CLAP plugin that passes the
scan filter)
Per-OS files: none. The change is one
#[cfg(target_os = "linux")]block insrc-tauri/src/audio/plugins/editor.rs; macOS and Windows compile the same codeas before.
🤖 Generated with Claude Code