Skip to content

Commit ab717ba

Browse files
author
Marlon Costa
committed
Merge PR winfunc#416: Linux Wayland/NVIDIA Fix
2 parents 6b2150f + 97a0f5f commit ab717ba

2 files changed

Lines changed: 20 additions & 4 deletions

File tree

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/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)