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

FyneApp.toml causes BadLength error #5272

Open
2 tasks done
AquilaFasciata opened this issue Nov 17, 2024 · 13 comments
Open
2 tasks done

FyneApp.toml causes BadLength error #5272

AquilaFasciata opened this issue Nov 17, 2024 · 13 comments
Labels
bug Something isn't working

Comments

@AquilaFasciata
Copy link

Checklist

  • I have searched the issue tracker for open issues that relate to the same problem, before opening a new one.
  • This issue only relates to a single bug. I will open new issues for any other problems.

Describe the bug

Current go app runs without a FyneApp.toml; upon inserting one (even copying the example in the Docs) causes the following error at runtime:

X Error of failed request:  BadLength (poly request too large or internal Xlib length error)
  Major opcode of failed request:  18 (X_ChangeProperty)
  Serial number of failed request:  246
  Current serial number in output stream:  246

Removing the toml results in a successful build and run.

How to reproduce

  1. Add FyneApp.toml
  2. Try go build, fyne build, or go run main.go and run executable
  3. Error occurs

Screenshots

No response

Example code

func main() {
	prog := app.New()
	mainWindow := prog.NewWindow("Expense Report Builder")
	mainWindow.Resize(fyne.Size{Height: 412, Width: 720})

	templateRow, templatePathBox := inputRow(&mainWindow, "Template: ", FILE)
	rosterRow, rosterPathBox := inputRow(&mainWindow, "Roster: ", FILE)
	outputRow, outputPathBox := inputRow(&mainWindow, "Output: ", FOLDER)
	runButton := widget.NewButton("Create Expense Reports", func() {
		err := business(rosterPathBox.Text, templatePathBox.Text, outputPathBox.Text)
		if err != nil {
			dialog.ShowError(err, mainWindow)
		}
	})

	mainWindow.SetContent(container.NewStack(
		container.NewVBox(
			templateRow, rosterRow, outputRow, runButton,
		),
	))

	mainWindow.ShowAndRun()
	// TODO Build ui
	// TODO Verify additions from Github
}

Fyne version

2.5.2

Go compiler version

1.23.2

Operating system and version

Arch Linux

Additional Information

This only appears to be an issue with the example code provided; simple "Hello, world" programs work (as well as the fyne demo app).

@AquilaFasciata AquilaFasciata added the unverified A bug that has been reported but not verified label Nov 17, 2024
@andydotxyz
Copy link
Member

Please share the FyneApp.toml that is causing issues on your machine for clarity.

Most apps include this file and we have never seen the issue reported, so perhaps there is something strange in the file encoding?

@AquilaFasciata
Copy link
Author

FyneApp.txt
Github doesn't allow .toml files, but it's the exact same other than the extension.

@andydotxyz
Copy link
Member

Oh wow I see.
Can you provide more info about the window manager or desktop you are using on Arch? So far I cannot replicate this...

@AquilaFasciata
Copy link
Author

AquilaFasciata commented Nov 20, 2024

I've tried this both on KDE Plasma 6, as well as Hyprland with the same error on both.

Curiously, I'm able to build for Windows with fyne-cross but not for Linux with fyne-cross due to a go: download go1.23 for linux/amd64: toolchain not available error. (This was a config error on my part)

@AquilaFasciata
Copy link
Author

For further review, the repo in question is public, just don't judge my poor code, it was thrown together and I'm new to Go 😅

@AquilaFasciata
Copy link
Author

So I was curious and I tried to build and run this in a fresh install of Ubuntu in a VM and had the same error -- it's entirely possible it's just my code.

@andydotxyz
Copy link
Member

Your window is asking for a width of 720, is it possible that your screen doesn't have space? That could cause x11 failures I guess.

Maybe try removing all the "Resize" calls to eliminate possibilities?

@AquilaFasciata
Copy link
Author

That was a good suggestion; however, I removed the Resize window, as well as all occurrences in child functions with no change

@AquilaFasciata
Copy link
Author

Okay, so I figured out what the issue was; my Icon.png was 2048x2048, which was far too large. I scaled it down to 256^2 and that seemed to do the trick. I would recommend having a max size recorded somewhere in the documentation if possible (I anticipate this is a *nix dependency that determines this).

@andydotxyz
Copy link
Member

Wow, good catch.

I guess we should consider scaling it down for the icon used in window borders - I am guessing that was the usage that triggered it.

In general our docs recommend 1024x1024 so hopefully we haven't been misleading anyone...

@AquilaFasciata
Copy link
Author

I never saw the 1024; I was looking in the Packaging for Desktop and the App Metadata sections on the fyne.io website.

@andydotxyz
Copy link
Member

Re-opening so we can stop huge icons from crashing the app.
It seems that anything over about 2000x2000 could cause this

@andydotxyz andydotxyz reopened this Dec 24, 2024
andydotxyz added a commit to andydotxyz/fyne that referenced this issue Dec 24, 2024
@andydotxyz
Copy link
Member

Fixed on develop, will be in the next release.

@andydotxyz andydotxyz added bug Something isn't working and removed unverified A bug that has been reported but not verified labels Dec 25, 2024
@andydotxyz andydotxyz added this to the E fixes (v2.5.x) milestone Dec 25, 2024
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