-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Closed
Labels
status: needs triageThis issue needs to triage, applied to new issuesThis issue needs to triage, applied to new issuestype: bug
Description
Describe the bug
The WindowEvent::Focused event does not get fired when listening for it via the App run callback.
Reproduction
- Consider the following code:
app.run(move |app_handle, e| {
match e {
RunEvent::WindowEvent { event, .. } => {
match event {
WindowEvent::Focused(focused) => {
println!("Focused: {}", focused);
}
_ => (),
}
}
_ => (),
}
});- Start the program
- Try to change the focus state of the window
- Observe
Expected behavior
The event should fire printing "Focused: true" or "Focused: false" to the console depending on the focused state of the window.
Platform and versions
Environment
› OS: Windows 10.0.22621 X64
› Webview2: 110.0.1587.69
› MSVC:
- Visual Studio Community 2019
› Node.js: 18.14.0
› npm: 9.3.1
› pnpm: 7.23.0
› yarn: 1.22.19
› rustup: 1.25.2
› rustc: 1.69.0-nightly
› cargo: 1.69.0-nightly
› Rust toolchain: nightly-x86_64-pc-windows-msvc
Packages
› @tauri-apps/cli [NPM]: 1.2.3
› @tauri-apps/api [NPM]: 1.2.0
› tauri [RUST]: 1.2.4,
› tauri-build [RUST]: 1.2.1,
› tao [RUST]: 0.15.8,
› wry [RUST]: 0.23.4,
App
› build-type: bundle
› CSP: unset
› distDir: ../dist
› devPath: http://localhost:1420/
› framework: React
› bundler: Vite
App directory structure
├─ .git
├─ .vscode
├─ dist
├─ node_modules
├─ public
├─ src
└─ src-tauri
Stack trace
No response
Additional context
Adding a handler for it via on_window_event works fine
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
status: needs triageThis issue needs to triage, applied to new issuesThis issue needs to triage, applied to new issuestype: bug