Closed
Description
Describe the bug
I created a custom tray window in Tauri. When I first call window.show()
on the tray window, triggering a blur
event (e.g., by clicking outside the window) correctly hides the window. However, after calling window.show()
again to redisplay the tray window, the blur
event no longer fires when the window loses focus. This prevents the window from being hidden again unless I manually click on the tray window first to "reactivate" it.
Environment:
- Tauri Version: [e.g.,
2.5.1
] - OS: [e.g., Windows 11]
Reproduction
- Create a tray window with
WindowBuilder
(or similar). - Call
window.show()
for the first time. - Trigger a
blur
event (e.g., click outside the window). The window hides as expected. - Call
window.show()
again to redisplay the tray window. - Attempt to trigger a
blur
event (e.g., click outside the window again). The event is not fired, and the window remains visible. - Click directly on the tray window to "focus" it, then clicking outside will finally hide it.
Expected behavior
The blur
event should consistently fire every time the tray window loses focus, regardless of how many times show()
is called.
Full tauri info
output
...
Stack trace
Additional context
No response