Skip to content

Commit b74ed39

Browse files
committed
Attempt fixing the traffic light position
- For macOS, we render the traffic lights at the top-left of windows in a custom way. But then, for whatever reason, production builds have a smaller traffic light. So we now take extra measures to position both the larger and smaller versions correctly. Very nitpicky but it did look very bad without this.
1 parent 8b937a6 commit b74ed39

4 files changed

Lines changed: 30 additions & 8 deletions

File tree

apps/desktop/src-tauri/src/lib.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -343,13 +343,13 @@ pub fn run() {
343343
let _ = window.set_title(&title);
344344
}
345345

346-
// Apply macOS overlay title bar at runtime (titleBarStyle removed from tauri.conf.json
347-
// because "Overlay" hides the native title bar on Linux/GTK, breaking window controls).
348-
// trafficLightPosition stays in JSON since it's macOS-only and ignored on other platforms.
349-
#[cfg(target_os = "macos")]
346+
// titleBarStyle is "Overlay" in JSON for macOS (needed so trafficLightPosition
347+
// is applied at window creation time — setting it at runtime resets the position).
348+
// On Linux/GTK, Overlay hides native window controls, so revert to Visible.
349+
#[cfg(target_os = "linux")]
350350
if let Some(window) = app.get_webview_window("main") {
351351
use tauri::TitleBarStyle;
352-
let _ = window.set_title_bar_style(TitleBarStyle::Overlay);
352+
let _ = window.set_title_bar_style(TitleBarStyle::Visible);
353353
}
354354

355355
// Initialize pane state store for MCP context tools

apps/desktop/src-tauri/tauri.conf.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,10 @@
1919
"minWidth": 950,
2020
"minHeight": 550,
2121
"visible": false,
22+
"titleBarStyle": "Overlay",
2223
"trafficLightPosition": {
2324
"x": 9,
24-
"y": 17
25+
"y": 11
2526
},
2627
"hiddenTitle": true,
2728
"acceptFirstMouse": true
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"app": {
3+
"windows": [
4+
{
5+
"title": "Cmdr",
6+
"width": 1080,
7+
"height": 720,
8+
"minWidth": 950,
9+
"minHeight": 550,
10+
"visible": false,
11+
"titleBarStyle": "Overlay",
12+
"trafficLightPosition": {
13+
"x": 9,
14+
"y": 17
15+
},
16+
"hiddenTitle": true,
17+
"acceptFirstMouse": true
18+
}
19+
]
20+
}
21+
}

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
"packageManager": "pnpm@10.32.1",
55
"scripts": {
66
"preinstall": "npx only-allow pnpm",
7-
"dev": "RUST_LOG=smb=warn,sspi=warn,${RUST_LOG:-info} pnpm --filter @cmdr/desktop tauri dev",
8-
"dev:ai-debug": "RUST_LOG=smb=warn,sspi=warn,cmdr_lib::ai=debug,${RUST_LOG:-info} pnpm --filter @cmdr/desktop tauri dev",
7+
"dev": "RUST_LOG=smb=warn,sspi=warn,${RUST_LOG:-info} pnpm --filter @cmdr/desktop tauri dev --config src-tauri/tauri.dev.conf.json",
8+
"dev:ai-debug": "RUST_LOG=smb=warn,sspi=warn,cmdr_lib::ai=debug,${RUST_LOG:-info} pnpm --filter @cmdr/desktop tauri dev --config src-tauri/tauri.dev.conf.json",
99
"build": "pnpm --filter @cmdr/desktop tauri build",
1010
"dev:website": "pnpm --filter @cmdr/website dev",
1111
"build:website": "pnpm --filter @cmdr/website build",

0 commit comments

Comments
 (0)