fix(slint): vendor femtovg-wgpu renderer for transparent window surface
Slint 1.16's femtovg-wgpu renderer configures the wgpu surface via get_default_config() and leaves the composite alpha mode at Auto, which resolves to an opaque surface on KWin/Wayland — a borderless transparent window then shows a black rectangular backing behind the rounded card. WGPUConfiguration exposes no surface/alpha hook, so the only fix is a renderer patch. Vendor i-slint-renderer-femtovg-1.16.1 with a preferred_alpha_mode() that picks a supported non-opaque mode (PreMultiplied / PostMultiplied / Inherit, guarded by the surface's advertised alpha_modes, else Auto) and wire it into set_surface(). Pulled in via [patch.crates-io]; Slint stays pinned =1.16.1. The main window is unaffected (it paints opaque). cx
This commit is contained in:
17 files changed
+6533
-2
No files matched your search
+55
@@ -0,0 +1,55 @@
|
||||
# Copyright © SixtyFPS GmbH <info@slint.dev>
|
||||
# SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-2.0 OR LicenseRef-Slint-Software-3.0
|
||||
|
||||
[package]
|
||||
name = "i-slint-renderer-femtovg"
|
||||
description = "FemtoVG based renderer for Slint"
|
||||
authors.workspace = true
|
||||
edition = "2024"
|
||||
homepage.workspace = true
|
||||
license.workspace = true
|
||||
repository.workspace = true
|
||||
rust-version.workspace = true
|
||||
version.workspace = true
|
||||
|
||||
[lib]
|
||||
path = "lib.rs"
|
||||
|
||||
[features]
|
||||
default = []
|
||||
opengl = []
|
||||
# wgpu-28 enables the wgpu backend for internal use (e.g. linuxkms DRM rendering).
|
||||
# unstable-wgpu-28 additionally exposes public API integration (GraphicsAPI, texture import).
|
||||
wgpu = ["wgpu-28"]
|
||||
wgpu-28 = ["dep:wgpu-28", "femtovg/wgpu", "i-slint-core/wgpu-28"]
|
||||
unstable-wgpu-27 = []
|
||||
unstable-wgpu-28 = ["wgpu-28", "i-slint-core/unstable-wgpu-28"]
|
||||
|
||||
[dependencies]
|
||||
i-slint-core = { workspace = true, features = ["default", "box-shadow-cache", "shared-fontique", "shared-parley"] }
|
||||
i-slint-core-macros = { workspace = true, features = ["default"] }
|
||||
i-slint-common = { workspace = true, features = ["default", "shared-fontique"] }
|
||||
|
||||
const-field-offset = { version = "0.2", path = "../../../helper_crates/const-field-offset" }
|
||||
|
||||
cfg-if = "1"
|
||||
derive_more = { workspace = true }
|
||||
lyon_path = { workspace = true }
|
||||
pin-weak = "1"
|
||||
femtovg = { version = "0.23.2", default-features = false, features = ["swash"] }
|
||||
imgref = { version = "1.6.1" }
|
||||
rgb = { version = "0.8.27" }
|
||||
|
||||
glow = { workspace = true }
|
||||
|
||||
wgpu-28 = { workspace = true, optional = true, default-features = true }
|
||||
|
||||
[target.'cfg(target_arch = "wasm32")'.dependencies]
|
||||
web-sys = { workspace = true, features = ["console", "WebGlContextAttributes", "CanvasRenderingContext2d", "HtmlInputElement", "HtmlCanvasElement", "Window", "Document"] }
|
||||
wasm-bindgen = { version = "0.2" }
|
||||
|
||||
[lints.rust]
|
||||
unexpected_cfgs = { level = "warn", check-cfg = ["cfg(slint_nightly_test)"] }
|
||||
|
||||
[package.metadata.docs.rs]
|
||||
rustdoc-args = ["--generate-link-to-definition"]
|
||||
Reference in new issue
Block a user