handle click dock icon to reopen app for Mac
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
//go:build darwin
|
||||
|
||||
package ui
|
||||
|
||||
/*
|
||||
void installReopenDelegate();
|
||||
*/
|
||||
import "C"
|
||||
|
||||
import "fyne.io/fyne/v2"
|
||||
|
||||
var darwinAppDelegateReopenWindow fyne.Window
|
||||
|
||||
func installReopenHandler(w fyne.Window) {
|
||||
darwinAppDelegateReopenWindow = w
|
||||
C.installReopenDelegate()
|
||||
}
|
||||
|
||||
//export appReopened
|
||||
func appReopened() {
|
||||
if darwinAppDelegateReopenWindow == nil {
|
||||
return
|
||||
}
|
||||
go func() {
|
||||
fyne.Do(darwinAppDelegateReopenWindow.Show)
|
||||
}()
|
||||
}
|
||||
Reference in New Issue
Block a user