🐛 fix: Not launching on Wayland (workaround)

This commit is contained in:
2025-11-08 20:27:32 +07:00
parent cdeaab4e0a
commit 3fdf7426bb
2 changed files with 51 additions and 0 deletions

View File

@@ -4,6 +4,21 @@
use std::env; use std::env;
fn main() { fn main() {
// Wayland workarounds for Linux
// https://github.com/tauri-apps/tauri/issues/10702
#[cfg(target_os = "linux")]
{
// Check if running on Wayland
if let Ok(session_type) = env::var("XDG_SESSION_TYPE") {
if session_type.to_lowercase() == "wayland" {
unsafe {
// env::set_var("WEBKIT_DISABLE_DMABUF_RENDERER", "1");
env::set_var("__NV_DISABLE_EXPLICIT_SYNC", "1");
}
}
}
}
let args: Vec<String> = env::args().collect(); let args: Vec<String> = env::args().collect();
if args.len() > 1 && args[1] == "--generate-bindings" { if args.len() > 1 && args[1] == "--generate-bindings" {

36
test.html Normal file
View File

@@ -0,0 +1,36 @@
<!DOCTYPE html>
<html>
<head>
<title>Test</title>
<style>
body {
margin: 0;
padding: 40px;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
color: white;
font-family: Arial, sans-serif;
}
h1 {
font-size: 48px;
margin-bottom: 20px;
}
.box {
background: rgba(255,255,255,0.2);
padding: 20px;
border-radius: 8px;
margin-top: 20px;
}
</style>
</head>
<body>
<h1>WebKitGTK Rendering Test</h1>
<div class="box">
<p>If you can see this text with styled colors and layout, WebKitGTK rendering is working!</p>
<p id="dynamic">JavaScript: <span style="color: yellow;">Testing...</span></p>
</div>
<script>
document.getElementById('dynamic').innerHTML = 'JavaScript: <span style="color: lime;">✓ Working!</span>';
console.log('Test page loaded successfully');
</script>
</body>
</html>