Fix Linux rendering issues and improve monospace font fallbacks (#243)

* fix: resolve AppImage blank white screen and font crash on Linux (#238)

Disable WebKitGTK DMA-BUF renderer by default on Linux to prevent blank
white screens caused by GPU buffer allocation failures (common with
NVIDIA drivers and immutable distros like Bazzite). Add Linux-native
monospace font fallbacks (DejaVu Sans Mono, Liberation Mono) to all font
stacks so WebKitGTK font resolution doesn't hit out-of-bounds vector
access when macOS-only fonts (SF Mono, Monaco) are unavailable.

https://claude.ai/code/session_01TF2NPgSSjgenmLT2XuR5b9

* fix: consolidate monospace font stacks into --font-mono variable

- Define --font-mono in :root (main.css) and .settings-shell (settings-window.css)
- Align font stack: SF Mono, Monaco, Cascadia Code, Fira Code, DejaVu Sans Mono, Liberation Mono
- Replace 3 hardcoded JetBrains Mono stacks with var(--font-mono)
- Replace 4 hardcoded settings-window stacks with var(--font-mono)
- Fix pre-existing bug: var(--font-mono) used in 4 places but never defined
- Match index.html skeleton font stack to --font-mono

---------

Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
Elie Habib
2026-02-23 07:16:48 +00:00
committed by GitHub
parent 0f4420d9cc
commit d24d61f333
4 changed files with 24 additions and 9 deletions

View File

@@ -97,7 +97,7 @@
<!-- Critical CSS: inline skeleton visible before JS boots -->
<style>
/* ---------- skeleton shell (dark default) ---------- */
.skeleton-shell{display:flex;flex-direction:column;height:100vh;background:#0a0a0a;font-family:'SF Mono','Monaco','Inconsolata','Fira Code',monospace;overflow:hidden}
.skeleton-shell{display:flex;flex-direction:column;height:100vh;background:#0a0a0a;font-family:'SF Mono','Monaco','Cascadia Code','Fira Code','DejaVu Sans Mono','Liberation Mono',monospace;overflow:hidden}
.skeleton-header{display:flex;align-items:center;justify-content:space-between;height:40px;padding:8px 16px;background:#141414;border-bottom:1px solid #2a2a2a;flex-shrink:0}
.skeleton-header-left{display:flex;align-items:center;gap:12px}
.skeleton-header-right{display:flex;align-items:center;gap:12px}

View File

@@ -872,6 +872,19 @@ fn stop_local_api(app: &AppHandle) {
}
fn main() {
// Work around WebKitGTK rendering issues on Linux that can cause blank white
// screens. DMA-BUF renderer failures are common with NVIDIA drivers and on
// immutable distros (e.g. Bazzite/Fedora Atomic). Setting the env var before
// WebKit initialises forces a software fallback path. Only set when the user
// hasn't explicitly configured the variable.
#[cfg(target_os = "linux")]
{
if env::var_os("WEBKIT_DISABLE_DMABUF_RENDERER").is_none() {
// SAFETY: called before any threads are spawned (Tauri hasn't started yet).
unsafe { env::set_var("WEBKIT_DISABLE_DMABUF_RENDERER", "1") };
}
}
tauri::Builder::default()
.menu(build_app_menu)
.on_menu_event(handle_menu_event)

View File

@@ -55,7 +55,8 @@
--map-stroke: #0f5040;
/* Font stack */
--font-body: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Code', monospace;
--font-mono: 'SF Mono', 'Monaco', 'Cascadia Code', 'Fira Code', 'DejaVu Sans Mono', 'Liberation Mono', monospace;
--font-body: var(--font-mono);
}
[dir="rtl"] {
@@ -927,7 +928,7 @@ canvas,
left: 50%;
transform: translateX(-50%);
font-size: 11px;
font-family: 'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;
font-family: var(--font-mono);
color: var(--text-secondary);
letter-spacing: 0.5px;
pointer-events: none;
@@ -1478,7 +1479,7 @@ canvas,
}
.webcam-city {
font-family: 'JetBrains Mono', 'Fira Code', monospace;
font-family: var(--font-mono);
font-size: 10px;
font-weight: 700;
color: #fff;
@@ -7783,7 +7784,7 @@ a.prediction-link:hover {
.pizzint-indicator {
position: relative;
z-index: 1000;
font-family: 'JetBrains Mono', monospace;
font-family: var(--font-mono);
}
.pizzint-toggle {
display: flex;

View File

@@ -12,6 +12,7 @@
--settings-yellow: #fbbf24;
--settings-red: var(--semantic-critical);
--settings-blue: #60a5fa;
--font-mono: 'SF Mono', 'Monaco', 'Cascadia Code', 'Fira Code', 'DejaVu Sans Mono', 'Liberation Mono', monospace;
height: 100vh;
background: var(--settings-bg);
@@ -231,7 +232,7 @@
color: var(--settings-text);
padding: 8px 12px;
font-size: 13px;
font-family: 'SF Mono', 'Cascadia Code', 'Fira Code', monospace;
font-family: var(--font-mono);
transition: border-color 0.15s;
}
@@ -253,7 +254,7 @@
color: var(--settings-text);
padding: 8px 12px;
font-size: 13px;
font-family: 'SF Mono', 'Cascadia Code', 'Fira Code', monospace;
font-family: var(--font-mono);
width: 100%;
cursor: pointer;
transition: border-color 0.15s;
@@ -561,7 +562,7 @@
.diag-table {
width: 100%;
border-collapse: collapse;
font-family: 'SF Mono', 'Cascadia Code', 'Fira Code', monospace;
font-family: var(--font-mono);
font-size: 12px;
}
@@ -707,7 +708,7 @@ tr.diag-err td { color: var(--settings-red); }
color: var(--settings-text);
padding: 8px 36px 8px 12px;
font-size: 13px;
font-family: 'SF Mono', 'Cascadia Code', 'Fira Code', monospace;
font-family: var(--font-mono);
transition: border-color 0.15s;
box-sizing: border-box;
}