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

Fix/1105 #1138

Merged
merged 3 commits into from Jun 28, 2020
Merged

Fix/1105 #1138

merged 3 commits into from Jun 28, 2020

Conversation

andydotxyz
Copy link
Member

@andydotxyz andydotxyz commented Jun 26, 2020

Description:

Fixing window size / resize handling on some bad Linux window managers.
Can be tested using demo code in each of the related issues.

Fixes #1105

Checklist:

  • Tests included.
  • Lint and formatter run with no errors.
  • Tests all pass.

This is pretty much Linux specific due to the order of
resize operations and scale detection.

Fixes fyne-io#1105
This is darwin specific and some linux systems were triggering
it by mistake.

May fix fyne-io#1103
Copy link
Member

@Jacalz Jacalz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes looks good to me and works fine on Linux 👍

@andydotxyz andydotxyz merged commit 7f83254 into fyne-io:develop Jun 28, 2020
@ghost
Copy link

ghost commented Jul 1, 2020

there's small inconsistency present with this PR applied at least on windows

func main() {
	app := app.New()
	win := app.NewWindow("window title")
	win.Resize(fyne.NewSize(200, 100))
	win.SetFixedSize(true)

	win.SetContent(widget.NewVBox(
		widget.NewLabel("long text to exceed initial window width"),
	))
	win.ShowAndRun()
}

This code is giving 200x100 sized window and it's width is adjusted once the window is dragged.
Commenting out Resize call is giving auto-sized window.
Removing SetFixedSize is adjusting the window width from the start.
Nothing critical, just a finding

@andydotxyz
Copy link
Member Author

Unfortunately I cannot replicate what you describe.
I think you mean that if SetFixedSize(true) is removed that the window does not appear at the size you specified, is that correct?

Can you please:

  • Check that you are running on the develop branch and confirm the latest commit so we can check
  • Show a screenshot or video of the window showing the wrong size?

Thanks

@ghost
Copy link

ghost commented Jul 1, 2020

Yes, removing SetFixedSize(true) call is giving width based on the content.

Here is the log (later is below):

8f5ebcd3 Some systems don't reset Raster type on resize, but we must  Andy Williams     Tue Jun 30 13:24:11 2020 +0100
f7e1114b Missed another comment                                       Andy Williams     Tue Jun 30 14:46:54 2020 +0100
 (upstream/fix/1114)
102ff9e4 Merge pull request #1150 from andydotxyz/fix/1114            Andy Williams     Tue Jun 30 19:28:36 2020 +0100
 (HEAD -> develop, upstream/develop)

image

on the image from the top to the bottom:

  1. resized and fixed size initially
  2. resized and fixed size after i dragged it a bit (same binary)
  3. resized and size is not fixed
  4. not resized, fixed size

It's hard to tell the size is wrong because it's explicitly resized and set to fixed size. That's why i called it inconsistent. It's not clear what is the correct behavior here

@andydotxyz
Copy link
Member Author

Oh I see, the issue is because you set fixedSize to be smaller than content?
That is indeed puzzling. I don't know what the right thing to do here is, we could:

  • Ensure fixedSize is always respected (and you will lose some content)
  • Update the size on load so that if you specify FixedSize too small it will enlarge

Both have pros and cons, I am not sure what is right...

@andydotxyz
Copy link
Member Author

I think this needs a new ticket, essentially "Setting FixedSize smaller than window content gives incosistent results"?
Could you open that please?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants