-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
[v2.10.1] Cannot quit when clicking and holding down on the window header #4264
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
Comments
Do you mean when you are holding and moving the window titlebar? |
Thank you for your comment. *Please note that this text is machine-translated. |
By displaying a dialog box before closing the application, the cursor was moved away from the title bar. package main
import (
"context"
"fmt"
"time"
// https://pkg.go.dev/github.com/wailsapp/wails/[email protected]/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/[email protected]/pkg/runtime#Quit
// Cannot quit when clicking and holding down on the window header. (windows11) (wails v2.10.1)
// 2025.05.17
// (Alternative Plan)
// Add a dialog box before the app exits.
// When the dialog box is displayed, the cursor moves away from the title bar
ShowMessageDialog(a.ctx)
// The application has closed.
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)
}
func ShowMessageDialog(ctx context.Context) {
runtime.MessageDialog(ctx, runtime.MessageDialogOptions{
Type: "info",
Title: "information",
Message: "The app will quit after the OK button is clicked.",
Buttons: []string{"OK"},
DefaultButton: "OK",
})
} *Please note that this text is machine-translated. |
Description
cannot quit when clicking and holding down on the window header
To Reproduce
Expected behaviour
app quit
Screenshots
Attempted Fixes
I Tried
System Details
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.
The text was updated successfully, but these errors were encountered: