-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Description
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
I am the author of Fortunate - https://github.com/zquestz/fortunate and recently updated to Fyne 2.6.1.
I noticed that the behavior of CenterOnScreen has changed dramatically between 2.5.2 and 2.6.1. In 2.5.2 it did what I would expect, which is centering the window on the screen, however in 2.6.1 it appears the upper left corner of the window is what was centered. This seems to only happen when SetFixedSize() is used. Oddly, it doesn't matter if true or false is used for SetFixedSize, if it is called at all, the centering is not working as expected. Removing the call to SetFixedSize completely causes the centering to work correctly, but obviously allows the window to be resized.
I did a bit of testing and the regression seems to have been introduced between v2.6.0-alpha1 and v2.6.0-beta1.
How to reproduce
- Write code that centers a window using
CenterOnScreenandSetFixedSize(). - Notice it is no longer centered as of 2.6.x.
Screenshots
Here is a screenshot of the new behavior.
Example code
appGUI = app.New()
aboutWindow = appGUI.NewWindow("About")
aboutWindow.CenterOnScreen()
aboutWindow.SetFixedSize(true)
aboutWindow.Show()
Fyne version
2.6.1
Go compiler version
1.24.3
Operating system and version
Linux seras 6.14.5-zen1-1-zen #1 ZEN SMP PREEMPT_DYNAMIC Sat, 03 May 2025 13:33:50 +0000 x86_64 GNU/Linux
Additional Information
No response
