handle click dock icon to reopen app for Mac

This commit is contained in:
Drew Weymouth
2026-03-14 19:38:41 -07:00
parent e23dfb8554
commit 9a30559343
4 changed files with 78 additions and 1 deletions
+27
View File
@@ -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)
}()
}