fix(desktop): Linux/Wayland freeze on ubuntu 25.10 while passing the window through a dual monitor setup with variable refresh rate #8416

Closed
opened 2026-02-16 18:09:55 -05:00 by yindo · 4 comments
Owner

Originally created by @IsraelAraujo70 on GitHub (Feb 3, 2026).

Originally assigned to: @adamdotdevin on GitHub.

Problem

On Ubuntu 25.10 (Wayland), OpenCode freezes when moving the window between monitors with different refresh rates (60Hz + 165Hz). The process stays alive; the UI becomes unresponsive and must be killed. This happens even with the terminal panel closed.

Environment

  • Ubuntu 25.10, GNOME/Mutter (Wayland)
  • Dual monitors: 60Hz + 165Hz
  • NVIDIA RTX 4060 (driver 590.48.01 open)

Repro

  1. Start OpenCode on a Wayland session.
  2. The app forces X11/XWayland (GDK_BACKEND=x11 / WINIT_UNIX_BACKEND=x11).
  3. Move the window between monitors while windowed.
  4. UI freezes (process still alive).

Evidence

  • Debug logs show Rust + UI heartbeats continue during the freeze.
  • gnome-shell logs: "Frame has assigned frame counter but no frame drawn time" at the freeze time.
  • No kernel NVRM/Xid, segfault, or coredump entries.

Workaround (Confirmed)

Run native Wayland (do not force X11):

OC_ALLOW_WAYLAND=1 env -u GDK_BACKEND -u WINIT_UNIX_BACKEND -u WEBKIT_DISABLE_DMABUF_RENDERER -u WEBKIT_DISABLE_COMPOSITING_MODE bun run tauri dev

Proposed Fix

  • On Linux, avoid forcing X11 by default (or auto-detect mixed refresh rate setups and prefer native Wayland).
  • Suggestion: add a Settings toggle to switch between Native Wayland and X11 fallback. The toggle would set/unset these env vars on Linux:
    • GDK_BACKEND
    • WINIT_UNIX_BACKEND
    • WEBKIT_DISABLE_DMABUF_RENDERER
    • WEBKIT_DISABLE_COMPOSITING_MODE
Originally created by @IsraelAraujo70 on GitHub (Feb 3, 2026). Originally assigned to: @adamdotdevin on GitHub. ## Problem On Ubuntu 25.10 (Wayland), OpenCode freezes when moving the window between monitors with different refresh rates (60Hz + 165Hz). The process stays alive; the UI becomes unresponsive and must be killed. This happens even with the terminal panel closed. ## Environment - Ubuntu 25.10, GNOME/Mutter (Wayland) - Dual monitors: 60Hz + 165Hz - NVIDIA RTX 4060 (driver 590.48.01 open) ## Repro 1) Start OpenCode on a Wayland session. 2) The app forces X11/XWayland (GDK_BACKEND=x11 / WINIT_UNIX_BACKEND=x11). 3) Move the window between monitors while windowed. 4) UI freezes (process still alive). ## Evidence - Debug logs show Rust + UI heartbeats continue during the freeze. - gnome-shell logs: "Frame has assigned frame counter but no frame drawn time" at the freeze time. - No kernel NVRM/Xid, segfault, or coredump entries. ## Workaround (Confirmed) Run native Wayland (do not force X11): ```bash OC_ALLOW_WAYLAND=1 env -u GDK_BACKEND -u WINIT_UNIX_BACKEND -u WEBKIT_DISABLE_DMABUF_RENDERER -u WEBKIT_DISABLE_COMPOSITING_MODE bun run tauri dev ``` ## Proposed Fix - On Linux, avoid forcing X11 by default (or auto-detect mixed refresh rate setups and prefer native Wayland). - Suggestion: add a Settings toggle to switch between Native Wayland and X11 fallback. The toggle would set/unset these env vars on Linux: - GDK_BACKEND - WINIT_UNIX_BACKEND - WEBKIT_DISABLE_DMABUF_RENDERER - WEBKIT_DISABLE_COMPOSITING_MODE
yindo added the perfweb labels 2026-02-16 18:09:55 -05:00
yindo closed this issue 2026-02-16 18:09:55 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Feb 3, 2026):

This issue might be a duplicate of existing issues. Please check:

  • #11527: OpenCode leaves an orphaned process when it itself is killed - addresses orphan process deparenting when OpenCode is terminated
  • #10563: Memory Leak: Orphaned processes when terminal closes without explicit exit - covers orphaned MCP child processes when terminal closure isn't handled properly
  • #7261: MCP orphan processes and memory bloat - documents orphaned processes accumulating across sessions and not being cleaned up on exit
  • #9505: Desktop app fails to start on Linux/Wayland - related Wayland stability issue on desktop

Feel free to ignore if none of these address your specific case.

@github-actions[bot] commented on GitHub (Feb 3, 2026): This issue might be a duplicate of existing issues. Please check: - #11527: OpenCode leaves an orphaned process when it itself is killed - addresses orphan process deparenting when OpenCode is terminated - #10563: Memory Leak: Orphaned processes when terminal closes without explicit exit - covers orphaned MCP child processes when terminal closure isn't handled properly - #7261: MCP orphan processes and memory bloat - documents orphaned processes accumulating across sessions and not being cleaned up on exit - #9505: Desktop app fails to start on Linux/Wayland - related Wayland stability issue on desktop Feel free to ignore if none of these address your specific case.
Author
Owner

@IsraelAraujo70 commented on GitHub (Feb 3, 2026):

@adamdotdevin Fan of your work. Can I have a shot at at fixing these?
I'm on Ubuntu 25 on wayland, and I currently have a lot of issues regarding perfomance on the opencode desktop app.

@IsraelAraujo70 commented on GitHub (Feb 3, 2026): @adamdotdevin Fan of your work. Can I have a shot at at fixing these? I'm on Ubuntu 25 on wayland, and I currently have a lot of issues regarding perfomance on the opencode desktop app.
Author
Owner

@IsraelAraujo70 commented on GitHub (Feb 3, 2026):

Latest repro + logs summary:

  • Env: Ubuntu 25.10, Wayland session. App was forcing X11/XWayland (GDK_BACKEND=x11 / WINIT_UNIX_BACKEND=x11). Dual monitors 60Hz + 165Hz.
  • Repro: move OpenCode window between monitors while windowed -> UI freezes (not a crash). Terminal panel closed.
  • Debug log: both UI and Rust heartbeats continue during the freeze (last ui.heartbeat 12:13:46, last rust.heartbeat 12:13:46). Last window.resized at 12:13:43; freeze ends only after manual kill. This points to compositor stall, not app thread crash.
  • Journal around freeze: gnome-shell "Frame has assigned frame counter but no frame drawn time" at 12:13:42. No kernel NVRM/Xid entries.

Workaround confirmed:

  • Running native Wayland (do not force X11/XWayland) avoids the freeze:
    OC_ALLOW_WAYLAND=1 env -u GDK_BACKEND -u WINIT_UNIX_BACKEND -u WEBKIT_DISABLE_DMABUF_RENDERER -u WEBKIT_DISABLE_COMPOSITING_MODE bun run tauri dev

Likely interaction between XWayland/Mutter and mixed refresh-rate monitors.

@IsraelAraujo70 commented on GitHub (Feb 3, 2026): Latest repro + logs summary: - Env: Ubuntu 25.10, Wayland session. App was forcing X11/XWayland (GDK_BACKEND=x11 / WINIT_UNIX_BACKEND=x11). Dual monitors 60Hz + 165Hz. - Repro: move OpenCode window between monitors while windowed -> UI freezes (not a crash). Terminal panel closed. - Debug log: both UI and Rust heartbeats continue during the freeze (last ui.heartbeat 12:13:46, last rust.heartbeat 12:13:46). Last window.resized at 12:13:43; freeze ends only after manual kill. This points to compositor stall, not app thread crash. - Journal around freeze: gnome-shell "Frame has assigned frame counter but no frame drawn time" at 12:13:42. No kernel NVRM/Xid entries. Workaround confirmed: - Running native Wayland (do not force X11/XWayland) avoids the freeze: `OC_ALLOW_WAYLAND=1 env -u GDK_BACKEND -u WINIT_UNIX_BACKEND -u WEBKIT_DISABLE_DMABUF_RENDERER -u WEBKIT_DISABLE_COMPOSITING_MODE bun run tauri dev` Likely interaction between XWayland/Mutter and mixed refresh-rate monitors.
Author
Owner

@tredondo commented on GitHub (Feb 10, 2026):

I've just installed 1.1.54 but can't toggle this setting:

Image

If it's disabled because I don't have an external monitor, that could be more clearly indicated, e.g. by graying out the setting name too, or adding a message to the tooltip.

BTW: is this setting solely to avoid that performance issues on dual-monitor setups with mixed refresh rates? When I'm running OpenCode on my Kubuntu Wayland laptop with no external screen, I see very slow scrolling in all panes.

@tredondo commented on GitHub (Feb 10, 2026): I've just installed 1.1.54 but can't toggle this setting: <img width="908" height="195" alt="Image" src="https://github.com/user-attachments/assets/ece800c5-d393-426f-aa2c-e16363ed5ab9" /> If it's disabled because I don't have an external monitor, that could be more clearly indicated, e.g. by graying out the setting name too, or adding a message to the tooltip. BTW: is this setting solely to avoid that performance issues on dual-monitor setups with mixed refresh rates? When I'm running OpenCode on my Kubuntu Wayland laptop with no external screen, I see very slow scrolling in all panes.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#8416