mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #4485] [GUI] the window keeps away the colour emoji font WebKitGTK dies on (Linux) #5066
Labels
No labels
needs-format
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Niko1221/Strata#5066
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Niko1221/Strata/pull/4485
Author: @miketgv
Created: 10/28/2026
Status: 🔄 Open
Base:
main← Head:gui-colrv1-emoji📝 Commits (1)
7a71ef7GUI: the window keeps away the colour emoji font WebKitGTK dies on (Linux)📊 Changes
4 files changed (+262 additions, -0 deletions)
View changed files
📝
apps/desktop/src-tauri/src/desktoplog.rs(+1 -0)➕
apps/desktop/src-tauri/src/fontguard.rs(+246 -0)📝
apps/desktop/src-tauri/src/main.rs(+7 -0)📝
docs/TROUBLESHOOTING.md(+8 -0)📄 Description
The problem
On Linux, the app window turns grey and stops answering when a chat draws an emoji, on any system whose colour emoji font is the COLRv1 format (Fedora 44 and newer Ubuntu ship it as the default). The window log says:
The WebKitGTK inside the AppImage paints COLRv1 through Skia, and
colrv1_configure_skpaintindexes past the end of a gradient's colour-stop vector. The library is built with_GLIBCXX_ASSERTIONS, so that read becomesabort()andWebKitWebProcessdies.What makes it bad rather than merely wrong is the recovery: the shell only watches the window process, and that process can stay alive when its web process dies. Nothing is then logged, nothing reloads, no crash log is written, and the person is left with a grey box and no message. A chat that contains an emoji reproduces it on every start that restores that chat.
The approach
Keep the one font family that cannot be drawn away from the window process — nothing else.
/etc/fonts/fonts.conffirst, so every other font resolves exactly as it does today, then rejects*/Noto-COLRv1.ttfand*/NotoSansCOLRv1-Regular.ttfinside<selectfont>and prefers the outlineNoto Emojifor theNoto Color Emojifamily. Emoji arrive as outlines instead of in colour.FONTCONFIG_FILEalready set stays untouched (the person's own choice wins).STRATA_FONT_CONFIG=offturns this off;STRATA_FONT_CONFIG=/path/to/fonts.confuses a file of theirs.The bitmap (
CBDT) and outline faces are not rejected — they draw fine, and hiding them would leave a tofu box instead of an emoji.Validation
Passed
cargo test --releasein the desktop shell: the 4 new tests infontguard.rspass — the file's contents and its<selectfont>nesting, that each reject sits inside it and that no placeholder is left unexpanded, both opt-outs and a custom file, the shallow scan (the bitmap and outline faces alone must not trigger it), and write-once-plus-refresh with no temporary left behind.cargo clippy --release: no findings in the new module. (It reports 8needless_borrowin the Linux drag-drop code, onedoc list item without indentationatmain.rs:22from commit322790af, and one dead function inshell.rs; all pre-existing, all left alone.)GLIBC_2.34, the same floor as the shippedstrata-desktop, and carries the sameRUNPATH=$ORIGIN/../lib, so it is a drop-in and no narrower than today.fc-listreturns 895 fonts with it and 896 without — the single difference isNoto-COLRv1.ttf.Noto Color Emojiandemojiresolve toNotoEmoji-Regular.ttf;sans-serif,monospace,Segoe UI,Noto Sans,DejaVu Sans MonoandCourier Newresolve exactly as before. Zero fontconfig warnings.WebKitWebProcessit forks carriesFONTCONFIG_FILE=…/fonts/fonts-no-colrv1.confin its own environment; the official 0.2.7 binary's web process has the variable unset. So the guard runs, runs before WebKit forks its renderer, and reaches the process that does the drawing. Both windows stayed up and served the page: no regression from the change.Failed (pre-existing, unchanged by this pull)
desktoplog::tests::a_failed_start_is_explained_in_plain_words_and_written_to_a_crash_fileasserts the literal"0.2.0"while the crate is0.2.7. It fails identically on pristineupstream/mainin the same container with these files removed. One-line fix, left out because it is not this problem.Not run
colrv1_configure_skpaint— which exists only in the COLRv1 path and is the onlycolrv1_*symbol in the library — plus the log lines and coredumps from the real app, and the same assertion and the same fontconfig workaround reported independently by other AppImage projects on Fedora 44. It is not a controlled before/after.#[cfg(target_os = "linux")].SIGSEGVcrashes on aJITWorkerthread seen on the reporting machine. A different fault, not addressed here — see limits.Limits
colrv1_configure_skpaint, and colour emoji in the window become outline emoji. The real fix belongs upstream in WebKitGTK/Skia.colrv1. A COLRv1 colour font under another name would still get through.WebKitWebView::connect_web_process_terminatedis available in the pinnedwebkit2gtk 2.0.2and is used nowhere in the shell. That deserves its own issue; a workaround for one renderer fault should not pretend the recovery path is fine.Reproduce
fc-match "Noto Color Emoji"returnsNoto-COLRv1.ttf).~/.local/share/strata/logs/desktop-*.logshows thecolrv1_configure_skpaintassertion;coredumpctlshowsWebKitWebProcesswithSIGABRT.Workaround for anyone hitting it before this lands: point
FONTCONFIG_FILEat a file that includes/etc/fonts/fonts.confand rejects*/Noto-COLRv1.ttfinside<selectfont>.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.