Skip to content

Could not create default EGL display: EGL_BAD_PARAMETER cc-switch blank window

Quick fix

On Linux, cc-switch forces WEBKIT_DISABLE_DMABUF_RENDERER=1, causing a blank window. Set it to 0 before launch to restore the UI.

Error output
CC Switch.desktop[29046]: Could not create default EGL display: EGL_BAD_PARAMETER. Aborting...

On Linux, `src-tauri/src/main.rs` unconditionally sets `WEBKIT_DISABLE_DMABUF_RENDERER=1` and `WEBKIT_DISABLE_COMPOSITING_MODE=1` unless the user has set them already. This workaround targets DMA-BUF renderer problems from the old NVIDIA / old WebKitGTK era. But in WebKitGTK 2.52 + Mesa 26 environments (such as AMD amdgpu), disabling DMABUF makes WebKit's fallback EGL path fail during initialization, causing WebProcess to abort on startup (`Could not create default EGL display: EGL_BAD_PARAMETER`). The WebView has no content and the main window is blank. `HardwareAccelerationPolicy::Never` only affects the acceleration policy for web content; it cannot prevent WebKit's own EGL initialization, so it has no effect.

The same environment variable intervention also led to two variants. In #4350 (3.16.2, Wayland + NVIDIA), the AppImage build hook `apprun-hooks/linuxdeploy-plugin-gtk.sh` unconditionally `export GDK_BACKEND=x11`, forcing XWayland. As a result, the webview content area receives no pointer events, although the GTK title bar works, and resizing causes a black screen. DMABUF variables do not fix the input issue. In #7059 (3.20.1, X11 + fcitx5 + hybrid graphics), clicking "Add → Custom" makes WebKitWebProcess hang. On this NVIDIA setup, setting DMABUF to 0 also causes a blank window, so environment variables alone cannot resolve both problems. A user also reproduced a blank window under WSL2/WSLg (WebKitGTK 2.52.6, Mesa 26.0.3), with the WebView child window collapsed to `1x1+-1+-1`; setting 0 did not work for this variant, which remains unresolved. The issues have different triggers, but all are directly related to cc-switch unconditionally changing WebKitGTK rendering environment variables.

  1. For a blank main window (EGL abort, #6514): set `WEBKIT_DISABLE_DMABUF_RENDERER=0` in the session environment. The app respects this external setting and does not override it. The main UI should then load normally. This was verified with both AppImage and native deb packages.

    /etc/environment(或写入会话环境)
    WEBKIT_DISABLE_DMABUF_RENDERER=0
  2. If that does not work and the version is 3.19.x, downgrade to 3.16.3. The reporter of #6514 confirmed 3.16.3 works; the problem started in 3.19.0.

  3. For unresponsive clicks in the webview content area and a black screen on resize under Wayland + NVIDIA (#4350, unrelated to DMABUF): extract the AppImage, change `GDK_BACKEND=x11` to `GDK_BACKEND=wayland` in `apprun-hooks/linuxdeploy-plugin-gtk.sh`, then run the extracted `AppRun`. Repacking after extraction breaks the Tauri updater's AppImage signature, so run the extracted directory directly instead of repacking it.

    AppImage 解包目录内 apprun-hooks/linuxdeploy-plugin-gtk.sh 第 9 行
    export GDK_BACKEND=x11
    export GDK_BACKEND=wayland
  4. For a full-window freeze when clicking "Add → Custom" under X11 + fcitx5 (#7059): launch cc-switch with `GTK_IM_MODULE=gtk-im-context-simple QT_IM_MODULE=simple XMODIFIERS=@im=none` to bypass the input freeze between fcitx5 and WebKitGTK 2.40+. The tradeoff is that fcitx5 cannot be used to type Chinese in the window.

  5. Long-term fixes suggested in the issues; maintainer progress is unknown: provide an overridable environment variable in the app (such as `CC_SWITCH_GDK_BACKEND`, proposed in #4350 with a PR attached), or set `WEBKIT_DISABLE_DMABUF_RENDERER=1` only when NVIDIA is detected.

Toolcc-switch
Version受影响范围 3.19.0 - 3.20.4(3.16.3 正常;另 #4350 的 GDK_BACKEND 变体见于 3.16.2)
PlatformsLinux
Under WSL2 / WSLg, the WebView still collapses to 1x1 and does not display after setting WEBKIT_DISABLE_DMABUF_RENDERER=0. Is there a fix or workaround?
There is currently no fix. This variant (WSL2 / Ubuntu 24.04 / WSLg, WebKitGTK 2.52.6, Mesa 26.0.3, cc-switch 3.20.4) was reported in a comment on #6514: the logs show no EGL_BAD_PARAMETER, and only WSLg startup falls back to software rendering through Xwayland glamor. Setting 0 and combining it with GDK_BACKEND=x11 or LIBGL_ALWAYS_SOFTWARE=1 do not work. No workaround is available for this variant.
Can I extract an AppImage, modify the hook, then repack and distribute it?
Not recommended. #4350 explicitly states that extracting and repacking after the build breaks the Tauri updater's AppImage signature. For a temporary workaround, run the extracted `AppRun` directly. The long-term solution is for the app to provide an overridable GDK_BACKEND setting; that issue has a PR attached.
DMABUF is disabled to address NVIDIA problems. Could setting it to 0 cause a blank window for NVIDIA users?
Yes. That is the conflict described in #7059: with X11 + hybrid graphics (Intel + NVIDIA RTX 5070 Ti), `WEBKIT_DISABLE_DMABUF_RENDERER=0` causes the same blank window (EGL abort) as #6514, while the default value of 1 causes a freeze when clicking "Custom" under fcitx5. Environment variables alone do not resolve both issues in this setup.

This is an unofficial community wiki with no affiliation to the cc-switch authors or the project itself. Its content is compiled from the project's public GitHub issues. This site distributes no software.