Skip to content

armgit / Handy

Public Imported from GitHub
0

A free, open source, and extensible speech-to-text application that works completely offline.

fix(linux): allow renderer opt-out without dropping crash protection (#2249)

CJ Pais48a3d8e9ee45
diff --git a/README.md b/README.md
index 4b4f5bcc..dd8a2b45 100644
--- a/README.md
+++ b/README.md
@@ -176,7 +176,7 @@ Without these tools, Handy falls back to enigo which may have limited compatibil
- For building from source on Ubuntu/Debian, you may also need `libgtk-layer-shell-dev`.
- The recording overlay is disabled by default on Linux (`Overlay Position: None`) because certain compositors treat it as the active window. When the overlay is visible it can steal focus, which prevents Handy from pasting back into the application that triggered transcription. If you enable the overlay anyway, be aware that clipboard-based pasting might fail or end up in the wrong window.
-- If you are having trouble with the app, running with the environment variable `WEBKIT_DISABLE_DMABUF_RENDERER=1` may help
+- Handy disables the WebKit DMA-BUF renderer by default on Linux, but preserves explicit `WEBKIT_DISABLE_DMABUF_RENDERER` values. For rendering workarounds, see [Troubleshooting → Linux Startup Crashes or Instability](#linux-startup-crashes-or-instability).
- If Handy fails to start reliably on Linux, see [Troubleshooting → Linux Startup Crashes or Instability](#linux-startup-crashes-or-instability).
- **Global keyboard shortcuts (Wayland):** On Wayland, system-level shortcuts must be configured through your desktop environment or window manager. Use the [CLI flags](#cli-parameters) as the command for your custom shortcut.
@@ -398,22 +398,34 @@ If installing the library does not help, you can skip `gtk-layer-shell` initiali
HANDY_NO_GTK_LAYER_SHELL=1 handy
```
-**3. Disable WebKit DMA-BUF renderer (`WEBKIT_DISABLE_DMABUF_RENDERER`)**
+**3. Configure WebKit DMA-BUF rendering (`WEBKIT_DISABLE_DMABUF_RENDERER`)**
-On some GPU/driver combinations the WebKitGTK DMA-BUF renderer can cause the window to fail to render or to crash. Try:
+Handy disables the WebKitGTK DMA-BUF renderer by default on Linux because it can cause blank windows or crashes on some GPU/driver combinations. Explicit environment-variable values are preserved, including in the Nix package. To explicitly keep the renderer disabled:
```bash
WEBKIT_DISABLE_DMABUF_RENDERER=1 handy
```
+Some users on WebKitGTK 2.54 report a flickering or partially drawn recording overlay with the renderer disabled ([#2166](https://github.com/cjpais/Handy/issues/2166)). If affected, try opting out of the default workaround:
+
+```bash
+WEBKIT_DISABLE_DMABUF_RENDERER=0 handy
+```
+
+This allows WebKit to use the renderer when supported, but can reintroduce the GPU/driver-specific crashes described above. Remove the override or use `=1` if that happens.
+
+Fully quit Handy, including its tray instance, before testing either value. Running a second instance with `--toggle-transcription` does not change the running process's environment.
+
**Making a workaround permanent**
-Once you've found a flag that helps, export it from your shell profile (`~/.bashrc`, `~/.zshenv`, …) or from the desktop autostart entry that launches Handy. If you launch Handy from a `.desktop` file, you can prefix the `Exec=` line, e.g.:
+Set the variable in the environment of the launcher that actually starts Handy. Shell profile exports may not apply to desktop-menu or autostart launches. If you launch Handy from a `.desktop` file, you can prefix the `Exec=` line, e.g.:
```ini
Exec=env HANDY_NO_GTK_LAYER_SHELL=1 handy
```
+Handy's built-in autostart rewrites its generated desktop entry, so editing that entry is not a durable workaround. For autostart, use an appropriate session/service environment, or disable Handy's built-in autostart and manage your own startup entry with the required variable.
+
If a workaround helps you, please [open an issue](https://github.com/cjpais/Handy/issues) describing your distro, desktop environment, and session type — that information helps us narrow down the underlying bug.
### Empty recording overlay on Hyprland / Omarchy
diff --git a/flake.nix b/flake.nix
index 28e217cc..c26e16b2 100644
--- a/flake.nix
+++ b/flake.nix
@@ -167,7 +167,7 @@
preFixup = ''
gappsWrapperArgs+=(
- --set WEBKIT_DISABLE_DMABUF_RENDERER 1
+ --set-default WEBKIT_DISABLE_DMABUF_RENDERER 1
--set ALSA_PLUGIN_DIR "${combinedAlsaPlugins}"
# Self-update can't work against an immutable /nix/store install
# (downloadAndInstall would try to overwrite the store path), so
diff --git a/src-tauri/src/main.rs b/src-tauri/src/main.rs
index db502060..025a42bd 100644
--- a/src-tauri/src/main.rs
+++ b/src-tauri/src/main.rs
@@ -9,7 +9,10 @@ fn main() {
{
// DMABUF renderer causes crashes on various GPU/display server configurations
// See: https://github.com/tauri-apps/tauri/issues/9394
- std::env::set_var("WEBKIT_DISABLE_DMABUF_RENDERER", "1");
+ // Preserve explicit overrides so affected users can opt out with =0 (#2166).
+ if std::env::var_os("WEBKIT_DISABLE_DMABUF_RENDERER").is_none() {
+ std::env::set_var("WEBKIT_DISABLE_DMABUF_RENDERER", "1");
+ }
}
#[cfg(target_os = "windows")]