-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
[bug] Window loses focus when creating another window with focus: false
, possible deadlock when re-focusing main window manually
#5120
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I've been seeing this issue too. Creating a new window with |
the |
You're right @amrbashir I guess we could change it to use |
we can't, |
* feat: add `WindowBuilder::with_focused` ref: tauri-apps/tauri#5120 * fix linux build * macos orderfront only * restore accept-focus * fix linux impl * remove set_transient_for call * Update src/window.rs * Update src/window.rs * Update src/platform_impl/linux/window.rs * fmt * import parent Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
Describe the bug
We want to be able to create a second window on the onFocus event in a React input component, while keeping the same input focused.
Seems like the intended way of doing this is setting the
focus
property tofalse
, but this doesn't seem to do the trick.We also tried using
setFocus()
inside the "tauri://created" listener to re-focus the primary window manually but this seems to cause a deadlock, as the cursor in the input is blinking but the first button pressed does not register.Reproduction
yarn
&&yarn start
tauri dev
Expected behavior
Create the window, while keeping the focus on the input component.
Platform and versions
Environment
› OS: Windows 10.0.19044 X64
› Webview2: 104.0.1293.70
› MSVC:
- Visual Studio Build Tools 2022
› Node.js: 16.15.0
› npm: 8.5.5
› pnpm: 7.1.0
› yarn: 1.22.15
› rustup: 1.25.1
› rustc: 1.62.1
› cargo: 1.62.1
› Rust toolchain: stable-x86_64-pc-windows-msvc
Packages
› @tauri-apps/cli [NPM]: 1.0.5
› @tauri-apps/api [NPM]: 1.0.2
› tauri [RUST]: 1.0.5,
› tauri-build [RUST]: 1.0.4,
› tao [RUST]: 0.12.2,
› wry [RUST]: 0.19.0,
App
› build-type: bundle
› CSP: default-src blob: data: filesystem: ws: http: https: 'unsafe-eval' 'unsafe-inline' 'self' img-src: 'self'
› distDir: ../build
› devPath: http://localhost:3000/
› framework: React
App directory structure
├─ .git
├─ node_modules
├─ public
├─ src
└─ src-tauri
Stack trace
Additional context
No response
The text was updated successfully, but these errors were encountered: