-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
When last visible window is closed, hidden window is set visible #3059
Comments
Wow this is super weird. Thanks for the clear steps to replicate. |
Interestingly the following code has no effect as the handler is attached to d.SetOnClosed(func() {
fmt.Printf("closing window: %d\n", count)
infoWindow.Close()
}) |
The SetOnClosed is is intentionally set on d, to close the window when the dialog closes. |
Ah thanks, I misunderstood because of the |
I notice also that the window which returns is not "alive" so it is not being shown with any purpose, Fyne seems to not be aware that the content is visible again. I wonder if we may have uncovered something relating to GLFW... |
And maybe that behavior is correct? I mean a systray app is conceptually having the systray icon as main window. |
Nope there is certainly something wrong. The window that appears is not alive. |
I have made this minimal example... tap the button will show window 2, close the first one to hide it then close the new one and we see a zombee window... package main
import (
"fyne.io/fyne/v2"
"fyne.io/fyne/v2/app"
"fyne.io/fyne/v2/theme"
"fyne.io/fyne/v2/widget"
)
var topWindow fyne.Window
func main() {
a := app.NewWithID("io.fyne.demo")
a.SetIcon(theme.FyneLogo())
topWindow = a.NewWindow("Top Window")
topWindow.SetContent(widget.NewButton("Open info", showInfo))
topWindow.SetCloseIntercept(func() {
topWindow.Hide()
})
topWindow.Show()
a.Run()
}
func showInfo() {
infoWindow := fyne.CurrentApp().NewWindow("Another")
infoWindow.SetContent(widget.NewLabel("Second"))
infoWindow.Show()
} |
Could the issue be, that |
Oh goodness you are right thanks @d1ss0nanz. |
Rolling out on v2.2.2 |
Describe the bug:
I'm looking for a reliable way to have a systray app that has no visible window.
When there is no hidden window, the app closes after the last visible window is closed.
If there is a hidden window left, the hidden window is set visible when the last visible window is closed.
To Reproduce:
Steps to reproduce the behaviour:
Please: Either don't make the top window visible or add an option to not close the app when a systray is running.
Example code:
Device (please complete the following information):
The text was updated successfully, but these errors were encountered: