Repository navigation
fix(plugins): realize the Linux editor window before embedding - #61
Open
ushiocheng wants to merge 1 commit into
Open
ushiocheng wants to merge 1 commit into
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>
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?
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