mirror of
https://github.com/AynaLivePlayer/AynaLivePlayer.git
synced 2025-12-06 10:22:50 +08:00
fix program not closed after hit close button
This commit is contained in:
@@ -35,7 +35,6 @@ func Initialize() {
|
||||
logger = global.Logger.WithPrefix("GUI")
|
||||
black_magic()
|
||||
logger.Info("Initializing GUI")
|
||||
_ = os.Setenv("FYNE_FONT", config.GetAssetPath("msyha.ttc"))
|
||||
if !config.General.UseSystemFonts {
|
||||
_ = os.Setenv("FYNE_FONT", config.GetAssetPath("msyh.ttc"))
|
||||
}
|
||||
@@ -71,6 +70,7 @@ func Initialize() {
|
||||
MainWindow.Resize(fyne.NewSize(config.General.Width, config.General.Height))
|
||||
|
||||
// todo: fix, window were created even if not show. this block gui from closing
|
||||
// i can't create sub window before the main window shows.
|
||||
// setupPlayerWindow()
|
||||
|
||||
// register error
|
||||
@@ -99,6 +99,7 @@ func Initialize() {
|
||||
MainWindow.SetOnClosed(func() {
|
||||
logger.Infof("GUI closing")
|
||||
if playerWindow != nil {
|
||||
logger.Infof("player window closing")
|
||||
playerWindow.Close()
|
||||
}
|
||||
})
|
||||
|
||||
@@ -17,6 +17,9 @@ func setupPlayerWindow() {
|
||||
}
|
||||
|
||||
func showPlayerWindow() {
|
||||
if playerWindow == nil {
|
||||
setupPlayerWindow()
|
||||
}
|
||||
playerWindow.Show()
|
||||
if playerWindowHandle == 0 {
|
||||
playerWindowHandle = xfyne.GetWindowHandle(playerWindow)
|
||||
|
||||
Reference in New Issue
Block a user