Skip to content

Commit 97a0f5f

Browse files
Chris Engelhardclaude
andcommitted
fix(linux): add Wayland/NVIDIA compatibility and resolve Rust warnings
- Add default-run = "opcode" to Cargo.toml to fix binary selection - Add automatic WEBKIT_DISABLE_DMABUF_RENDERER for Wayland sessions - Fix snake_case warnings in web_server.rs (sessionId -> session_id) - Suppress dead_code warning for register_sidecar_process 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent 70c16d8 commit 97a0f5f

4 files changed

Lines changed: 22 additions & 4 deletions

File tree

src-tauri/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ description = "GUI app and Toolkit for Claude Code"
55
authors = ["mufeedvh", "123vviekr"]
66
license = "AGPL-3.0"
77
edition = "2021"
8+
default-run = "opcode"
89

910
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
1011

src-tauri/src/main.rs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,22 @@ use tauri::Manager;
5252
use window_vibrancy::{apply_vibrancy, NSVisualEffectMaterial};
5353

5454
fn main() {
55+
// Apply Linux/Wayland workarounds for WebKitGTK GBM buffer issues (especially on NVIDIA)
56+
// This must be done before any GTK/WebKit initialization
57+
#[cfg(target_os = "linux")]
58+
{
59+
use std::env;
60+
// Only apply fix for Wayland sessions where GBM buffer issues occur
61+
let is_wayland = env::var("WAYLAND_DISPLAY").is_ok()
62+
|| env::var("XDG_SESSION_TYPE")
63+
.map(|v| v == "wayland")
64+
.unwrap_or(false);
65+
66+
if is_wayland && env::var("WEBKIT_DISABLE_DMABUF_RENDERER").is_err() {
67+
env::set_var("WEBKIT_DISABLE_DMABUF_RENDERER", "1");
68+
}
69+
}
70+
5571
// Initialize logger
5672
env_logger::init();
5773

src-tauri/src/process/registry.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ impl ProcessRegistry {
8282
}
8383

8484
/// Register a new running agent process using sidecar (similar to register_process but for sidecar children)
85+
#[allow(dead_code)]
8586
pub fn register_sidecar_process(
8687
&self,
8788
run_id: i64,

src-tauri/src/web_server.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -233,17 +233,17 @@ async fn resume_claude_code() -> Json<ApiResponse<serde_json::Value>> {
233233
}
234234

235235
/// Cancel Claude execution
236-
async fn cancel_claude_execution(Path(sessionId): Path<String>) -> Json<ApiResponse<()>> {
236+
async fn cancel_claude_execution(Path(session_id): Path<String>) -> Json<ApiResponse<()>> {
237237
// In web mode, we don't have a way to cancel the subprocess cleanly
238238
// The WebSocket closing should handle cleanup
239-
println!("[TRACE] Cancel request for session: {}", sessionId);
239+
println!("[TRACE] Cancel request for session: {}", session_id);
240240
Json(ApiResponse::success(()))
241241
}
242242

243243
/// Get Claude session output
244-
async fn get_claude_session_output(Path(sessionId): Path<String>) -> Json<ApiResponse<String>> {
244+
async fn get_claude_session_output(Path(session_id): Path<String>) -> Json<ApiResponse<String>> {
245245
// In web mode, output is streamed via WebSocket, not stored
246-
println!("[TRACE] Output request for session: {}", sessionId);
246+
println!("[TRACE] Output request for session: {}", session_id);
247247
Json(ApiResponse::success(
248248
"Output available via WebSocket only".to_string(),
249249
))

0 commit comments

Comments
 (0)