Linux: forced WEBKIT_DISABLE_DMABUF_RENDERER=1 makes the main window transparent on WebKitGTK 2.54 (only repainted regions show)
Maintainer thường phản hồi trong vòng 1 ngày
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 25/100
Hướng nghiên cứu
The forced variable is set unconditionally in apps/desktop/src-tauri/src/main.rs, lines 48-51, under a #[cfg(target_os = "linux")] block. Read that block, then check the linked PR #2628 before starting, since it is already open against this issue. Done means the variable is skipped when the user has already set it, and the window renders on WebKitGTK 2.54 without the shim.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Description
On Linux with WebKitGTK 2.54, Cap's main window is almost entirely invisible. The window exists (KWin reports it mapped, 330×395, not hidden/minimized), but only the regions that get repainted show up: a hovered button, a toggle being animated, etc. Everything else stays transparent, so you see the desktop through the window.
The cause is the unconditional override added for #1948:
#[cfg(target_os = "linux")]
unsafe {
std::env::set_var("WEBKIT_DISABLE_DMABUF_RENDERER", "1");
}
With WebKitGTK 2.54, disabling the DMABUF renderer on a transparent window makes WebKit repaint only the damaged areas, and the rest of the surface is never painted. Other Tauri projects hit the same regression on 2.54 (e.g. rogeriojunior31/vultures-ai#126, xnmp/tauri-explorer#1057).
Because the variable is overwritten with set_var, users can't opt out: running WEBKIT_DISABLE_DMABUF_RENDERER=0 Cap still yields WEBKIT_DISABLE_DMABUF_RENDERER=1 in the environment of Cap's WebKitWebProcess (checked via /proc/<pid>/environ).
Reproduction
- Debian 13, KDE Plasma 6.3 Wayland, WebKitGTK 2.54.0.
- Install Cap 0.6.0 (
.deb) and launch it. - The main window is transparent except for elements being hovered or animated.
What I tried
All of these still show the bug, because the forced variable stays in effect:
GDK_BACKEND=x11(XWayland)WEBKIT_DISABLE_COMPOSITING_MODE=1WEBKIT_SKIA_ENABLE_CPU_RENDERING=1- forcing Mesa EGL instead of NVIDIA (
__EGL_VENDOR_LIBRARY_FILENAMES=.../50_mesa.json) WEBKIT_FORCE_COMPOSITING_MODE=1
Workaround that fixes it: an LD_PRELOAD shim that turns setenv("WEBKIT_DISABLE_DMABUF_RENDERER", …) into a no-op. With the variable unset, the window renders fully and correctly on this machine.
#define _GNU_SOURCE
#include <dlfcn.h>
#include <string.h>
int setenv(const char *name, const char *value, int overwrite) {
static int (*real)(const char *, const char *, int);
if (!real) real = dlsym(RTLD_NEXT, "setenv");
if (name && strcmp(name, "WEBKIT_DISABLE_DMABUF_RENDERER") == 0) return 0;
return real(name, value, overwrite);
}
Suggested fix
At minimum, respect a value the user already set, so people can opt out without a shim:
#[cfg(target_os = "linux")]
if std::env::var_os("WEBKIT_DISABLE_DMABUF_RENDERER").is_none() {
unsafe { std::env::set_var("WEBKIT_DISABLE_DMABUF_RENDERER", "1"); }
}
Better still, don't apply the workaround by default on WebKitGTK ≥ 2.54 (or limit it to the configurations from #1948), since it now breaks rendering instead of fixing it.
Environment
- Cap 0.6.0 (
.deb) - Debian GNU/Linux 13 (trixie), kernel 6.12
- KDE Plasma / KWin 6.3.6, Wayland session
- libwebkit2gtk-4.1 2.54.0
- Hybrid GPU: Intel Raptor Lake UHD (i915) + NVIDIA RTX 4060 Laptop (driver 555.58.02)
Related: #1948, #1553
- Ngôn ngữ chính
- Rust
- Star
- 23.2k
- Fork
- 2k
- Merge trung bình
- 1 ngày 5 giờ
- Pull request đã merge (30 ngày)
- 130
Chuẩn bị môi trường
- Có Dockerfile hoặc tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của CapSoftware/Cap
-
Web player intercepts ⌘⇧M and blocks Chrome profile-menu shortcutCó thể đã có người làm @AatmanAJ đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 80/100
CapSoftware/Cap#2596 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
CapSoftware/Cap#2384 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Dashboard pagination causes full page reloads on self-hosted CapCó thể đã có người làm @Dewin đã nhận 29 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
CapSoftware/Cap#2305 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
CapSoftware/Cap#1714 · 3 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
macOS: main-thread panic in tauri-runtime-wry 2.8.1 freezes Cap mid Instant recording; the crashed recording then can't be recovered or reuploadedCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 18/100
CapSoftware/Cap#2606 · 3 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của CapSoftware/Cap
Issue tương tự
-
area: compat area: parsing bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
reubeno/brush#1526 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
OFN writer emits `DocIRI` as a bare IRI, which becomes a version IRI or a parse error on re-readĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
phillord/horned-owl#338 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
type/bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
stackabletech/operator-rs#1301 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
jmcnamara/rust_xlsxwriter#205 · 4 bình luận ·