Skip to content
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

widgets freeze after being in background and then a crash upon clicking widget.Check or right-clicking widget.Entry #2536

Closed
smcio opened this issue Oct 7, 2021 · 1 comment
Labels
bug Something isn't working

Comments

@smcio
Copy link
Contributor

smcio commented Oct 7, 2021

Describe the bug:

In a number of its features, my application creates a window on top of another window, with the new window containing a VBox that itself contains a form. This form typically houses a number of widgets, including widget.Entry fields, widget.Check widgets, these widgets are sometimes housed within grid containers.

When a window from another application is placed over the Fyne window (the newly created one, not my main window), and a fairly short period of time elapses (a few minutes), and the window is brought "back into focus", the window's widget.Entry fields are unresponsive; there is no cursor and you cannot write in the field. As such, the fields in the window appear to be "frozen".

The window can be "woken up" or "unfrozen" via two means:

  • Manually resizing the window
  • Clicking a button in the window, if there is one. If a button is clicked, the button's callback is executed and the window's fields become responsive again.

Further to this "freezing" effect, when "frozen", clicking on a widget.Check results in a crash. A typical panic dump has been reproduced below:

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x30 pc=0x44c27da]

goroutine 2960064 [running]:
fyne.io/fyne/v2/widget.(*Check).Tapped(0xc002618090, 0xc002af6fd0)
        /Users/XXXX/go/pkg/mod/fyne.io/fyne/v2@v2.1.0/widget/check.go:190 +0x11a
fyne.io/fyne/v2/internal/driver/glfw.(*window).mouseClickedHandleTapDoubleTap.func1()
        /Users/XXXX/go/pkg/mod/fyne.io/fyne/v2@v2.1.0/internal/driver/glfw/window.go:885 +0x38
fyne.io/fyne/v2/internal/driver/common.(*Window).RunEventQueue(0xc002928200)
        /Users/XXXX/go/pkg/mod/fyne.io/fyne/v2@v2.1.0/internal/driver/common/window.go:58 +0x66
created by fyne.io/fyne/v2/internal/driver/glfw.(*gLDriver).createWindow.func1
        /Users/XXXX/go/pkg/mod/fyne.io/fyne/v2@v2.1.0/internal/driver/glfw/window.go:1388 +0x11c
exit status 2

The crash occurs in the Tapped handler function, at this line:

		fyne.CurrentApp().Driver().CanvasForObject(c.super()).Focus(c.super().(fyne.Focusable))

I have verified that "fyne.CurrentApp().Driver().CanvasForObject(c.super())" returns nil.

In addition, right-clicking in a "frozen" field results in a crash such as the following:

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0xa8 pc=0x43284ce]

goroutine 2434 [running]:
fyne.io/fyne/v2/internal/widget.(*overlayRenderer).MinSize(0xc00059ba80, 0xc0004595e0)
        /Users/XXXX/go/pkg/mod/fyne.io/fyne/v2@v2.1.0/internal/widget/overlay_container.go:96 +0x2e
fyne.io/fyne/v2/internal/widget.(*Base).MinSize(0xc0004595e0, 0x5ad0898)
        /Users/XXXX/go/pkg/mod/fyne.io/fyne/v2@v2.1.0/internal/widget/base.go:88 +0x62
fyne.io/fyne/v2/widget.NewPopUpMenu(0xc0027a7f28, 0x0, 0x0, 0x0)
        /Users/XXXX/go/pkg/mod/fyne.io/fyne/v2@v2.1.0/widget/popup_menu.go:29 +0x1b3
fyne.io/fyne/v2/widget.(*Entry).TappedSecondary(0xc002136f00, 0xc0020f76e0)
        /Users/XXXX/go/pkg/mod/fyne.io/fyne/v2@v2.1.0/widget/entry.go:526 +0x585
fyne.io/fyne/v2/internal/driver/glfw.(*window).mouseClicked.func2()
        /Users/XXXX/go/pkg/mod/fyne.io/fyne/v2@v2.1.0/internal/driver/glfw/window.go:835 +0x66
fyne.io/fyne/v2/internal/driver/common.(*Window).RunEventQueue(0xc00061c200)
        /Users/XXXX/go/pkg/mod/fyne.io/fyne/v2@v2.1.0/internal/driver/common/window.go:58 +0x66
created by fyne.io/fyne/v2/internal/driver/glfw.(*gLDriver).createWindow.func1
        /Users/XXXX/go/pkg/mod/fyne.io/fyne/v2@v2.1.0/internal/driver/glfw/window.go:1388 +0x11c
exit status 2

Please note that this "frozen" issue and crashing issues only seem to occur when the window in question has a window from another app placed over it, i.e. the window is taken out of focus. If you simply sit there with the window on the screen, none of the above happens :)

To Reproduce:

Steps to reproduce symptoms provided in the description above.

The two crashes occur when a field is right-clicked and when a checkbox is clicked.

Example code:

I've been unable to produce a minimal working example to demonstrate the issue.

Device (please complete the following information):

  • OS: macOS and Windows
  • Version: Big Sur and Windows 10, respectively
  • Go version: go1.16.5
  • Fyne version: 2.1.0
@smcio smcio added the unverified A bug that has been reported but not verified label Oct 7, 2021
@andydotxyz andydotxyz changed the title widget.Entry Fields frozen and then a crash upon clicking widget.Check or right-clicking widget.Entry widgets freeze after being in background and then a crash upon clicking widget.Check or right-clicking widget.Entry Oct 7, 2021
@andydotxyz andydotxyz added bug Something isn't working and removed unverified A bug that has been reported but not verified labels Oct 7, 2021
@andydotxyz andydotxyz added this to the Fixes (v2.1.x) milestone Oct 7, 2021
@andydotxyz
Copy link
Member

On develop for testing, will pull it into release/v2.1.x shortly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants