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_size] setWindowMinSize and setWindowMaxSize not setting correct window size on Linux #854

Open
Letal1s opened this issue May 14, 2021 · 2 comments

Comments

@Letal1s
Copy link

Letal1s commented May 14, 2021

When making a flutter app for Linux, the initial size can be set by altering the parameters of gtk_window_set_default_size() in my_application.cc:
gtk_window_set_default_size(window, 450, 750);

Then trying to set maximum and minimum sizes using the window_size plugin in dart code using the same dimensions:

final fixedSize = Size(450, 750);
setWindowMinSize(fixedSize);
setWindowMaxSize(fixedSize);

However when setting this maximum and minimum the window is resized to below the size set initially in the native code using GTK, despite using the same dimensions. Wouldn't the expected behaviour be for the app not to change size at all?

@stuartmorgan
Copy link
Collaborator

stuartmorgan commented May 17, 2021

These are pretty straightforward passthroughs to GTK window methods; perhaps there's a subtle behavioral difference between size and geometry APIs.

Out of curiosity, if you are changing the runner code already, why aren't you just setting gtk_window_set_resizable to false, which seems to be what you want here?

@Letal1s
Copy link
Author

Letal1s commented May 17, 2021

I did in fact end up changing gtk_window_set_resizable once I'd looked at GTK documentation some more and that seems to work fine. The only reason I started medalling in the runner code anyway was because of the window size not being set correctly through the functions I detailed though. I thought I'd bring this up as it certainly was a bit odd, and upon trying to retrieve the window size in dart code after being set this way the values have in fact decreased significantly from what was passed into the functions.

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

No branches or pull requests

2 participants