Skip to content
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

[bug] Tauri App's Close Functionality Fails After Minimize/Maximize Actions (Windows) #9504

Open
tance77 opened this issue Apr 18, 2024 · 0 comments
Labels
status: needs triage This issue needs to triage, applied to new issues type: bug

Comments

@tance77
Copy link

tance77 commented Apr 18, 2024

Describe the bug

Encountered an issue where minimizing and then attempting to close a Tauri application. Results in the close handler losing its scope. This prevents the close handler from functioning as expected.

Minimal Reproduction Example

GitHub Repository

Behavior Observed

The application is set up to intercept the WINDOW_CLOSE_REQUESTED event and prevent the default behavior, which typically closes the application. Instead, it invokes a Tauri command to hide the window. The application features a system tray implementation which allows it to remain open in the background and can be reopened with a click event on the system tray icon.

Additional Notes

This issue seems to be triggered by specific interactions with window size adjustments and the taskbar functionalities when the application is in a minimized state.

I also have not tested this on Mac and may exist there too.

Reproduction

  1. Run the application using npm run tauri dev.
  2. Right-click the application icon in the taskbar and choose "Pin to taskbar".
  3. Optionally, click "Close" on the application window to observe it hiding instead of closing.
  4. Click the Tauri icon in the system tray to display the window again. (Note: Clicking the icon pinned to the taskbar won't show the window in dev mode.)
  5. Simultaneously press Win + Up Arrow and Win + Down Arrow to alternate window size. During this, right-click the pinned taskbar icon and choose "Close", while continuing to alternate window size with the arrows.
  6. Attempt to close the application by clicking the 'X' button; observe that the application does not hide as expected, indicating a malfunction.

Expected behavior

The close handler to continue to function as a close handler

Full tauri info output

[✔] Environment
    - OS: Windows 10.0.22621 X64
    ✔ WebView2: 123.0.2420.97
    ✔ MSVC:
        - Visual Studio Build Tools 2017
        - Visual Studio Build Tools 2022
    ✔ rustc: 1.77.1 (7cf61ebde 2024-03-27)
    ✔ cargo: 1.77.1 (e52e36006 2024-03-26)
    ✔ rustup: 1.27.0 (bbb9276d2 2024-03-08)
    ✔ Rust toolchain: stable-x86_64-pc-windows-msvc (default)
    - node: 18.14.0
    - npm: 9.3.1

[-] Packages
    - tauri [RUST]: 1.6.1
    - tauri-build [RUST]: 1.5.1
    - wry [RUST]: 0.24.7
    - tao [RUST]: 0.16.8
    - @tauri-apps/api [NPM]: 1.5.3
    - @tauri-apps/cli [NPM]: 1.5.11

[-] App
    - build-type: bundle
    - CSP: unset
    - distDir: ../dist
    - devPath: http://localhost:1420/
    - framework: Vue.js
    - bundler: Vite

Stack trace

No response

Additional context

Minimize_Maximize_Single_Instance_Bug.mp4
@tance77 tance77 added status: needs triage This issue needs to triage, applied to new issues type: bug labels Apr 18, 2024
@tance77 tance77 changed the title [bug] Tauri App's Close Functionality Fails After Minimize/Maximize Actions [bug] Tauri App's Close Functionality Fails After Minimize/Maximize Actions (Windows) Apr 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: needs triage This issue needs to triage, applied to new issues type: bug
Projects
None yet
Development

No branches or pull requests

1 participant