Skip to content

[v2.10.1] Cannot quit when clicking and holding down on the window header #4264

@educator-art

Description

@educator-art

Description

cannot quit when clicking and holding down on the window header

To Reproduce

  1. create project
wails init -n myproject -t vanilla
  1. edit app.go
package main

import (
	"context"
	"fmt"
	"time"

	// https://pkg.go.dev/github.com/wailsapp/wails/v2@v2.10.1/pkg/runtime#Quit
	runtime "github.com/wailsapp/wails/v2/pkg/runtime"
)

// App struct
type App struct {
	ctx context.Context
}

// NewApp creates a new App application struct
func NewApp() *App {
	return &App{}
}

// startup is called when the app starts. The context is saved
// so we can call the runtime methods
func (a *App) startup(ctx context.Context) {
	a.ctx = ctx
	time.Sleep(10 * time.Second)
	// https://pkg.go.dev/github.com/wailsapp/wails/v2@v2.10.1/pkg/runtime#Quit
	// Cannot quit when clicking and holding down on the window header. (windows11) (wails v2.10.1)
	runtime.Quit(a.ctx)
}

// Greet returns a greeting for the given name
func (a *App) Greet(name string) string {
	return fmt.Sprintf("Hello %s, It's show time!", name)
}
  1. run
wails dev 

Expected behaviour

app quit

Screenshots

Image

Attempted Fixes

I Tried

System Details

Wails Doctor



# Wails
Version | v2.10.1


# System
┌────────────────────────────────────────────────────────────────────────┐
| OS           | Windows 10 Pro                                          |
| Version      | 2009 (Build: 26100)                                     |
| ID           | 24H2                                                    |
| Go Version   | go1.24.2                                                |
| Platform     | windows                                                 |
| Architecture | amd64                                                   |
| CPU          | AMD Ryzen 5 4500 6-Core Processor                       |
| GPU          | NVIDIA GeForce GTX 1630 (NVIDIA) - Driver: 32.0.15.7283 |
| Memory       | 32GB                                                    |
└────────────────────────────────────────────────────────────────────────┘

# Dependencies
┌───────────────────────────────────────────────────────┐
| Dependency | Package Name | Status    | Version       |
| WebView2   | N/A          | Installed | 135.0.3179.98 |
| Nodejs     | N/A          | Installed | 20.9.0        |
| npm        | N/A          | Installed | 10.1.0        |
| *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!

 ♥   If Wails is useful to you or your company, please consider sponsoring the project:
https://github.com/sponsors/leaanthony

Additional context

※Updated to Windows 11

I would appreciate it if you could help me with this

*Please note that this text is machine-translated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions