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

Ctrl+v into text input field crashes app. Presumably clipboard is empty. #1123

Closed
dbriemann opened this issue Jun 21, 2020 · 3 comments
Closed
Labels
bug Something isn't working
Milestone

Comments

@dbriemann
Copy link

Describe the bug:

I am on Ubuntu Mate 20.04.

Using ctrl+v on a text input field of the fyne_demo crashes the application when clipboard is empty with the following stacktrace:

GLFW: An invalid error was not accepted by the caller: FormatUnavailable: X11: Failed to convert selection to string
GLFW: Please report this bug in the Go package immediately.
panic: FormatUnavailable: X11: Failed to convert selection to string

goroutine 10 [running, locked to thread]:
github.com/go-gl/glfw/v3.3/glfw.acceptError(0x0, 0x0, 0x0, 0xc0007cff90, 0xc000216060)
	/home/dlb/Coding/go/pkg/mod/github.com/go-gl/glfw/v3.3/glfw@v0.0.0-20200222043503-6f7a984d4dc4/error.go:178 +0x201
github.com/go-gl/glfw/v3.3/glfw.panicError(...)
	/home/dlb/Coding/go/pkg/mod/github.com/go-gl/glfw/v3.3/glfw@v0.0.0-20200222043503-6f7a984d4dc4/error.go:185
github.com/go-gl/glfw/v3.3/glfw.(*Window).MakeContextCurrent(0xc00023c000)
	/home/dlb/Coding/go/pkg/mod/github.com/go-gl/glfw/v3.3/glfw@v0.0.0-20200222043503-6f7a984d4dc4/context.go:18 +0x41
fyne.io/fyne/internal/driver/glfw.(*window).RunWithContext(0xc00010cb60, 0xc0007cfe88)
	/home/dlb/Coding/go/src/fyne.io/fyne/internal/driver/glfw/window.go:1008 +0x2e
fyne.io/fyne/internal/driver/glfw.(*gLDriver).repaintWindow(0xc00007c2c0, 0xc00010cb60)
	/home/dlb/Coding/go/src/fyne.io/fyne/internal/driver/glfw/loop.go:147 +0x60
fyne.io/fyne/internal/driver/glfw.(*gLDriver).startDrawThread.func1(0xc000036480, 0xc00007e190, 0xc00007c2c0)
	/home/dlb/Coding/go/src/fyne.io/fyne/internal/driver/glfw/loop.go:193 +0x217
created by fyne.io/fyne/internal/driver/glfw.(*gLDriver).startDrawThread
	/home/dlb/Coding/go/src/fyne.io/fyne/internal/driver/glfw/loop.go:169 +0xbd

To Reproduce:

Steps to reproduce the behaviour:

  1. Log into system
  2. Start the fyne_demo
  3. Go to Widgets->Input
  4. ctrl+v into the first input field (Entry).
  5. crash

Device (please complete the following information):

  • OS: Ubuntu Mate
  • Version: 20.04
  • Go version: go1.14.3
  • Fyne version: commit a82c328
@andydotxyz
Copy link
Member

Verified on macOS as well as Linux. It's not often that you have an empty clipboard, but when you do this is a reliable crash.

@dbriemann
Copy link
Author

dbriemann commented Jun 21, 2020

I found this issue: #743

I checked the code and I think that glfw changed the error message and that's why the recover from the fix does not work anymore.

It might be an option to not pass empty strings to the glfw.SetClipboardString functions instead in your (c *clipboard).SetContent(content string) in fyne/internal/driver/glfw/clipboard.go.

Edit: forget what I wrote. I looked at this again and this should not be related to SetContent because it reads from the clipboard and does not write to it.

@andydotxyz andydotxyz added the bug Something isn't working label Jun 21, 2020
@andydotxyz andydotxyz added this to the 1.3.x milestone Jun 21, 2020
@andydotxyz
Copy link
Member

On develop for testing

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