Skip to main content

WindowBuild

Function WindowBuild 

Source
pub fn WindowBuild(
    Application: &mut App,
    LocalhostUrl: String,
) -> WebviewWindow<Wry>
Expand description

Creates and configures the main application window.

§Arguments

  • Application - The Tauri application instance
  • LocalhostUrl - The localhost URL for the webview content

§Returns

A configured WebviewWindow<Wry> instance.

§Platform-Specific Behavior

  • macOS: TitleBarStyle::Overlay + hidden_title(true) keeps the traffic-light buttons at the top-left but hides the native title bar strip, so VS Code’s custom titlebar (which has -webkit-app-region: drag baked into its CSS) lights up the entire top row as a drag region. The previous maximized(true) was the direct cause of “can’t drag the editor around” - maximized macOS windows are pinned to the screen and refuse all drag events, regardless of app-region CSS.
  • Windows / Linux: decorations(false) keeps the window chrome-less so the workbench draws its own. We still start resizable(true) so the window can be moved by the drag region.
  • Debug builds: DevTools auto-open.