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

Application only closes after mouse movement following frontend interaction #3882

Open
VdanielVPL opened this issue Nov 12, 2024 · 4 comments
Labels
Bug Something isn't working

Comments

@VdanielVPL
Copy link

Description

The application does not close when the window's close (X) button is clicked after interacting with the frontend. The app only closes if the mouse is moved after clicking the close button.

To Reproduce

  1. Create a new Wails project with React and TypeScript: wails init -n myproject -t react-ts
  2. Start the application.
  3. In the frontend, click the Greet button.
  4. Move the mouse over the close (X) button in the application window and click it without moving the mouse afterward.
  5. Notice that the application does not close immediately. However, moving the mouse even 1 pixel causes the application to close.

Expected behaviour

The application should close immediately upon clicking the close (X) button, without requiring additional mouse movement.

Screenshots

No response

Attempted Fixes

I tried several methods to fix this issue, but none have resolved the problem so far:

  1. Listening to the wails:window:close event:
  • I used runtime.EventsOn(ctx, "wails:window:close", func(optionalData ...interface{}) { runtime.Quit(ctx) }) in Go to handle the close event and call runtime.Quit(ctx) directly, but the issue persisted.
    Using OnBeforeClose and OnShutdown:
  1. I attempted to clear the shutdown-related handlers by setting them to nil in the app struct. This included resetting any relevant fields related to shutdown processing, but the issue persisted.

  2. I also commented out the front-end click handlers to check if any JavaScript was blocking the closure, but the behavior remained the same.

System Details

Wails Doctor



# Wails
Version | v2.9.2

# System
┌────────────────────────────────────────────────────────────────────────┐
| OS           | Windows 10 Pro                                          |
| Version      | 2009 (Build: 22631)                                     |
| ID           | 23H2                                                    |
| Go Version   | go1.23.2                                                |
| Platform     | windows                                                 |
| Architecture | amd64                                                   |
| CPU          | Intel(R) Core(TM) i7-9700K CPU @ 3.60GHz                |
| GPU          | NVIDIA GeForce GTX 1080 (NVIDIA) - Driver: 32.0.15.6603 |
| Memory       | 32GB                                                    |
└────────────────────────────────────────────────────────────────────────┘

# Dependencies
┌───────────────────────────────────────────────────────┐
| Dependency | Package Name | Status    | Version       |
| WebView2   | N/A          | Installed | 130.0.2849.80 |
| Nodejs     | N/A          | Installed | 20.9.0        |
| npm        | N/A          | Installed | 10.2.1        |
| *upx       | N/A          | Available |               |
| *nsis      | N/A          | Available |               |
└─────────────── * - Optional Dependency ───────────────┘

# Diagnosis
Optional package(s) installation details:
  - upx : Available at https://upx.github.io/
  - nsis : More info at https://wails.io/docs/guides/windows-installer/

 SUCCESS  Your system is ready for Wails development!

Additional context

No response

@VdanielVPL VdanielVPL added the Bug Something isn't working label Nov 12, 2024
@leaanthony
Copy link
Member

Thanks for reporting this. This was something that came up a couple of times before and sometimes it could be observed and other times not. I'll try and dig out the previous discussions around this.

@leaanthony
Copy link
Member

Leaving this link here for me: #1273

@leaanthony
Copy link
Member

I'm wondering if anyone else can confirm this.

@ronen25
Copy link

ronen25 commented Nov 17, 2024

Reproduced on an old-ish Win 10 machine I've got lying around and on a Windows 11 Surface Pro 9, but not on my Mac.

Maybe it's something specific to Windows?

# Wails
Version | v2.9.2

# System
┌───────────────────────────────────────────────────────────────────────────────────────────────────┐
| OS           | Windows 10 Pro                                                                     |
| Version      | 1903 (Build: 18362)                                                                |
| ID           |                                                                                    |
| Go Version   | go1.23.3                                                                           |
| Platform     | windows                                                                            |
| Architecture | amd64                                                                              |
| CPU          | Intel(R) Core(TM) i7-6700 CPU @ 3.40GHz                                            |
| GPU          | Radeon (TM) RX 480 Graphics (Advanced Micro Devices, Inc.) - Driver: 26.20.12028.2 |
| Memory       | 16GB                                                                               |
└───────────────────────────────────────────────────────────────────────────────────────────────────┘

# Dependencies
┌───────────────────────────────────────────────────────┐
| Dependency | Package Name | Status    | Version       |
| WebView2   | N/A          | Installed | 130.0.2849.80 |
| Nodejs     | N/A          | Installed | 20.18.0       |
| npm        | N/A          | Installed | 10.8.2        |
| *upx       | N/A          | Available |               |
| *nsis      | N/A          | Available |               |
└─────────────── * - Optional Dependency ───────────────┘
# Wails
Version | v2.9.2

# System
┌─────────────────────────────────────────────────────────────────────────────────────────┐
| OS           | Windows 10 Home                                                          |
| Version      | 2009 (Build: 22631)                                                      |
| ID           | 23H2                                                                     |
| Go Version   | go1.23.3                                                                 |
| Platform     | windows                                                                  |
| Architecture | amd64                                                                    |
| CPU          | 12th Gen Intel(R) Core(TM) i7-1255U                                      |
| GPU          | Intel(R) Iris(R) Xe Graphics (Intel Corporation) - Driver: 30.0.101.3118 |
| Memory       | 16GB                                                                     |
└─────────────────────────────────────────────────────────────────────────────────────────┘

# Dependencies
┌───────────────────────────────────────────────────────┐
| Dependency | Package Name | Status    | Version       |
| WebView2   | N/A          | Installed | 130.0.2849.80 |
| Nodejs     | N/A          | Installed | 22.11.0       |
| npm        | N/A          | Installed | 10.9.0        |
| *upx       | N/A          | Available |               |
| *nsis      | N/A          | Available |               |
└─────────────── * - Optional Dependency ───────────────┘

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants