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

window.Resize is not respected at startup with 2.6.0-pre when SetContent is called after Show #5463

Open
2 tasks done
hkparker opened this issue Jan 25, 2025 · 5 comments
Open
2 tasks done
Labels
blocker Items that would block a forthcoming release bug Something isn't working

Comments

@hkparker
Copy link
Contributor

hkparker commented Jan 25, 2025

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

window.Resize does not apply if window.SetContent is called after window.Show

It used to in 2.5.3. Is this behavior we should keep in 2.6.0?

How to reproduce

call window.SetContent after window.Show

Screenshots

2.5.3:
Image

bb1657e:
Image

Example code

package main

import (
	"fyne.io/fyne/v2"
	"fyne.io/fyne/v2/app"
	"fyne.io/fyne/v2/container"
	"fyne.io/fyne/v2/widget"
)

func main() {
	demo := app.New()
	window := demo.NewWindow("Demo")
	window.SetMaster()
	window.Resize(fyne.Size{Height: 400, Width: 400})

	window.Show()
	window.SetContent(container.NewCenter(widget.NewLabel("this is a label")))

	demo.Run()
}

Fyne version

bb1657e

Go compiler version

go1.23.4 linux/amd64

Operating system and version

Arch Linux

Additional Information

No response

@hkparker hkparker added the unverified A bug that has been reported but not verified label Jan 25, 2025
@Jacalz Jacalz added the information-needed Further information is requested label Jan 25, 2025
@hkparker
Copy link
Contributor Author

@Jacalz this occurs when set content is called after show, but does not occur when set content is set before show. Updated ticket with screenshots and example code. Since this is a behavior change 2.5.3->2.6.0 this is probably a bug, but maybe not.

@hkparker hkparker changed the title window.Resize is not respected at startup with 2.6.0-pre window.Resize is not respected at startup with 2.6.0-pre when SetContent is called after Show Jan 25, 2025
@andydotxyz
Copy link
Member

Does the window show large and then get smaller? Or is it calling SetContent so fast after show that it just appears at the wrong size?

@hkparker
Copy link
Contributor Author

I didn't notice it start large, from my perspective it just appears the wrong size. I moved things around in my code have it working by calling Show later, but is SetContent supposed to resize the window like this?

@andydotxyz
Copy link
Member

but is SetContent supposed to resize the window like this?

SetContent ensures that the window is at least minimum size. It should not cause the window to shrink if the min is less than current size.

@andydotxyz andydotxyz added bug Something isn't working blocker Items that would block a forthcoming release and removed unverified A bug that has been reported but not verified information-needed Further information is requested labels Jan 27, 2025
@andydotxyz andydotxyz added this to the "F" release, Early 2025 milestone Jan 27, 2025
@hkparker
Copy link
Contributor Author

Right ok that makes sense. I use SetContent later after the app is up without this problem too, and it doesn't resize anything as far as I recall

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocker Items that would block a forthcoming release bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants