In Tauri config file, there is a focus option in window configuration, which supposedly specifies the focus state when the window is initially created. However, the current behaviour is no matter it's set to true or false in the config file, when the dev server starts, the program always gain focus. Setting this to false is the same as true.
If instead, remove the windows object from config file and use Rust to create window with WebviewWindowBuilder, the window can be set to not focus when created with .focused(false), and setting config file should have the same effect, which is not the case.
Reproduction
Create a test project with pnpm create tauri-app
Choose some sane defaults
Install dependencies with pnpm install, run the dev server. The default config should focus the window when launched
Describe the bug
In Tauri config file, there is a
focus
option in window configuration, which supposedly specifies the focus state when the window is initially created. However, the current behaviour is no matter it's set totrue
orfalse
in the config file, when the dev server starts, the program always gain focus. Setting this to false is the same as true.If instead, remove the windows object from config file and use Rust to create window with
WebviewWindowBuilder
, the window can be set to not focus when created with.focused(false)
, and setting config file should have the same effect, which is not the case.Reproduction
pnpm create tauri-app
pnpm install
, run the dev server. The default config should focus the window when launchedExpected behavior
Window should not be focused when
focused
is set to false.It should be the same as created manually with:
Full
tauri info
outputStack trace
Additional context
No response