-
-
Notifications
You must be signed in to change notification settings - Fork 609
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
After starting the new window has dimensions 0x0 #764
Comments
Nice job figuring this out, could also be the solution to #737 I will add the proposed fix in the next commit and let you know so you can test it on your system. |
Yes, i think #737 and mine are the same. I also have a proposition:
Because the ordinary width and height are not the maximum and minimum. They are more related to the initial size of root Or even better (i don't know how do you feel about this) -- add ability to knock to the Stage/Scene directly. Thanks! |
Some food for thought... I'll give it a go some time tomorrow and see what works best. |
Before moving this further, please can you check if using
The next version (dev snapshot) uses JavaFX 13, which according to this thread fixes the window size issues. |
The dev-SNAPSHOT doesn't work too. When i put break point at the very end the If i add two lines of code like below -- it works: public void start(Stage stage) {
stage.setMinHeight(768);
stage.setMinWidth(1024);
Thread.setDefaultUncaughtExceptionHandler((thread, e) -> {
this.handleFatalError(e);
});
GameApplication.log.debug("Initializing FXGL");
this.engine = new Engine(settings);
FXGL.inject$fxgl(this.engine, app, this);
StartupScene startupScene = settings.getSceneFactory().newStartup();
MainWindow mainWindow = new MainWindow(stage, startupScene, settings);
mainWindow.show();
this.engine.getEnvironmentVars$fxgl().put("settings", settings);
this.engine.getEnvironmentVars$fxgl().put("mainWindow", mainWindow);
this.engine.initServicesAndStartLoop();
} p.s. Yes i've read about jfx-13 version, but i thought the fix will be available for 11 version too. I faced with similar problems on my other pet-projects and such solution help me. |
I'll try with jfx-13 tomorrow. |
Interestingly I could not reproduce the issue using, though I am running this on a virtual box.
I will try a different OS mentioned in the other issue. If I can't reproduce, I will probably try something like this in
|
Right, I've reproduced the issue with manjaro kde linux, with javafx 12.0.1. After switching to The log should say: |
I've changed the version of javafx.
Now it works ! Even with the FXGL-11.7. |
The window by default is not resizable, you need to enable it via |
Thanks! I think the problem is settled. |
Great! I'll keep the issue open until |
Fixed in |
On the screenshot you see the code and the result.
The window doesn't take into account the values were put to the settings. So it has as small size as the OS can let.
But i found the root of the problem (as i think). If to debug the code you may notice the minHeight and minWidth of the stage are 0-s.
Look at this code snippet from the FXGL library
If to add such, lines everything works fine.
Environment:
The text was updated successfully, but these errors were encountered: