🔧 ProgrammierungBolt.new launches Forge to widen who gets to build with AI(17.09.2026 um 22:12 Uhr)
🔧 ProgrammierungGlobal Workspace Theory The J-Space of Claude(17.09.2026 um 22:12 Uhr)
🔧 AI Nachrichten I let a local 27B LLM audit and fix my Splunk + Sysmon stack(17.09.2026 um 22:15 Uhr)
🔧 ProgrammierungHow to Run Docker/Containers With Termux(17.09.2026 um 22:20 Uhr)
🔧 ProgrammierungI Accidentally Built a Dark Software Factory. Here's How.(17.09.2026 um 22:21 Uhr)
🔧 ProgrammierungCongrats to the DEV Weekend Challenge: Dog Days Edition Winners!(17.09.2026 um 22:22 Uhr)
🔧 ProgrammierungBolt.new launches Forge to widen who gets to build with AI(17.09.2026 um 22:12 Uhr)
🔧 ProgrammierungGlobal Workspace Theory The J-Space of Claude(17.09.2026 um 22:12 Uhr)
🔧 AI Nachrichten I let a local 27B LLM audit and fix my Splunk + Sysmon stack(17.09.2026 um 22:15 Uhr)
🔧 ProgrammierungHow to Run Docker/Containers With Termux(17.09.2026 um 22:20 Uhr)
🔧 ProgrammierungI Accidentally Built a Dark Software Factory. Here's How.(17.09.2026 um 22:21 Uhr)
🔧 ProgrammierungCongrats to the DEV Weekend Challenge: Dog Days Edition Winners!(17.09.2026 um 22:22 Uhr)
🔧 Programmierung 🕛 vor 4 Monaten 3 Min Lesezeit
0

Building a Menubar App with Tauri v2 — What Nobody Tells You

↗ Quelle (dev.to)
🗣️ Stimme:

All tests run on an 8-year-old MacBook Air.

All results from shipping 7 Mac apps as a solo developer. No sponsored opinion.



Menubar apps look simple from the outside. A tray icon, a popover, done.



The actual implementation has enough edge cases that I wish someone had written this before I started.



The basic setup

Tauri v2 has first-class tray icon support. The fundamentals:



rust

use tauri::{

tray::{TrayIconBuilder, TrayIconEvent},

Manager,

};



TrayIconBuilder::new()

.icon(app.default_window_icon().unwrap().clone())

.on_tray_icon_event(|tray, event| {

if let TrayIconEvent::Click { .. } = event {

// toggle window

}

})

.build(app)?;

Hide from Dock and App Switcher

A menubar app shouldn't appear in the Dock or Cmd+Tab switcher. Set this in Info.plist:



xml

LSUIElement



Or in tauri.conf.json:



json

{

"bundle": {

"macOS": {

"infoPlist": {

"LSUIElement": true

}

}

}

}

Without this, users will be confused why a menubar app appears in the Dock. This is the first thing to set.



Window positioning

The window should appear below the tray icon, not in the center of the screen. Tauri doesn't handle this automatically.



Get the tray icon position and calculate:



rust

fn position_window_near_tray(window: &WebviewWindow, tray_rect: &tauri::PhysicalRect) {

let window_size = window.outer_size().unwrap();

let x = tray_rect.position.x + (tray_rect.size.width as i32 / 2)

- (window_size.width as i32 / 2);

let y = tray_rect.position.y + tray_rect.size.height as i32;

window.set_position(tauri::PhysicalPosition::new(x, y)).ok();

}

Account for screen edges. A window that opens half off-screen on a secondary monitor is a real edge case worth handling.



Show/hide vs create/destroy

Two approaches: keep the window hidden and show/hide it, or create and destroy it on each toggle.



Show/hide is simpler and faster. The window stays in memory. State persists between opens.



Create/destroy resets state on each open. Good for apps where you want a fresh start each time. Slower on older hardware.



I use show/hide for all my menubar apps. The state persistence is a feature, not a bug.



rust

if window.is_visible().unwrap_or(false) {

window.hide().ok();

} else {

window.show().ok();

window.set_focus().ok();

}

Auto-hide when focus is lost

Click elsewhere, window disappears. Users expect this from menubar apps.



rust

window.on_window_event(|event| {

if let WindowEvent::Focused(false) = event {

window.hide().ok();

}

});

One edge case: if your window opens a dialog or file picker, the focus loss will close the main window before the dialog appears. Add a flag to suppress auto-hide when a child window is open.



The verdict

Menubar apps in Tauri v2 are well-supported. The gaps are window positioning, auto-hide behavior, and the LSUIElement setting. All solvable — just not documented in one place until now.



If this was useful, a ❤️ helps more than you'd think — thanks!



Hiyoko PDF Vault →

Vollständiger Original-Artikel
Den kompletten Beitrag mit allen Details direkt auf dev.to lesen.
↗ Original-Artikel auf dev.to lesen
Wie bewertest du diesen Beitrag?
1 Klick Feedback
Teilen mit Netzwerk & Team:

Community-Analysen & Experten-Meinungen 0

Verfasse deine eigene Analyse, teile Workarounds oder diskutiere diesen Vorfall im Blog.
Noch keine Community-Analyse verfasst. Markiere einen Textabschnitt oder klicke oben auf Eigene Analyse verfassen“!
Community Pulse: Relevanz-Einschätzung
1 Klick Experten-Votum
🔴 Akute Relevanz 0%
🟡 In Evaluierung 0%
🟢 Keine Auswirkung 0%
Spannende Innovation 0%
Verwandte Story-Cluster & Quellen (Vektor-KI)
Port 8095 Engine
1 Quelle
Bolt.new launches Forge to widen who gets to build with AI
1 Quelle
Common Pitfalls in RAG Applications: What to Avoid When Using Vector Search and Embeddings
1 Quelle
Turn Your Android Phone Into a Local Development Server With Termux
Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten Building a Menubar App with Tauri v2 — What Nobody Tells You

Thematisch verwandte Begriffe: Building, Menubar, with, Tauri · 6 Treffer

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...