0

EDIT:

After some testing with options it turns out that when call: stage.initStyle(StageStyle.UNDECORATED) on the stage it resolve this problem of the window not showing, but then the window does not have controls. That means it might have to do with the window Manager and Controls.

ORIGINAL:

I am starting a JavaFX Stage with a Scene loaded from a FXML File using a FXML Loader.

This is a rather weird issue since no Exceptions or other form of error is displayed. Now only a part of the window gets rendered, shown here: Here the wrongly rendered window

Here the Correct form as reference(Excluding the two entries in the ListView on the left): enter image description here

Since i don´t get any errors i can only add information that might help resolve the problem.

-Dprism.verbose=true Output:

[12.12.2018 19:50:48 | MSG] Using Double Precision Marlin Rasterizer
[12.12.2018 19:50:48 | MSG] Using dirty region optimizations
[12.12.2018 19:50:48 | MSG] Not using texture mask for primitives
Not f[12.12.2018 19:50:48 | MSG] orcing power of 2 sizes for textures
[12.12.2018 19:50:48 | MSG] Using hardware CLAMP_TO_ZERO mode
[12.12.2018 19:50:48 | MSG] Opting in for HiDPI pixel scaling
[12.12.2018 19:50:48 | MSG] Prism pipeline name = com.sun.prism.es2.ES2Pipeline
[12.12.2018 19:50:48 | MSG] Loading ES2 native library ... prism_es2
[12.12.2018 19:50:48 | MSG]     succeeded.
[12.12.2018 19:50:48 | MSG] GLFactory using com.sun.prism.es2.X11GLFactory
[12.12.2018 19:50:49 | MSG] (X) Got class = class com.sun.prism.es2.ES2Pipeline
[12.12.2018 19:50:49 | MSG] Initialized prism pipeline: com.sun.prism.es2.ES2Pipeline
[12.12.2018 19:50:49 | MSG] Maximum supported texture size: 32768
[12.12.2018 19:50:49 | MSG] Maximum texture size clamped to 4096
[12.12.2018 19:50:49 | MSG] Non power of two texture support = true
[12.12.2018 19:50:49 | MSG] Maximum number of vertex attributes = 16
[12.12.2018 19:50:49 | MSG] Maximum number of uniform vertex components = 4096
[12.12.2018 19:50:49 | MSG] Maximum number of uniform fragment components = 4096
[12.12.2018 19:50:49 | MSG] Maximum number of varying components = 124
[12.12.2018 19:50:49 | MSG] Maximum number of texture units usable in a vertex shader = 32
[12.12.2018 19:50:49 | MSG] Maximum number of texture units usable in a fragment shader = 32
[12.12.2018 19:50:49 | MSG] Graphics Vendor: NVIDIA Corporation
[12.12.2018 19:50:49 | MSG]        Renderer: GeForce GTX 1060 6GB/PCIe/SSE2
[12.12.2018 19:50:49 | MSG]         Version: 4.6.0 NVIDIA 390.77
[12.12.2018 19:50:49 | ERROR]  vsync: true vpipe: true
[12.12.2018 19:50:49 | MSG] file:/home/liz3/IdeaProjects/SkIDE/out/production/resources/images/icon.png
[12.12.2018 19:50:50 | MSG] ES2ResourceFactory: Prism - createStockShader: Solid_TextureRGB.frag
[12.12.2018 19:50:50 | MSG] ES2ResourceFactory: Prism - createStockShader: Solid_TextureFirstPassLCD.frag
[12.12.2018 19:50:50 | MSG] ES2ResourceFactory: Prism - 
createStockShader: Solid_TextureSecondPassLCD.frag
[12.12.2018 19:50:50 | MSG] new alphas with length = 4096
[12.12.2018 19:50:50 | MSG] ES2ResourceFactory: Prism - createStockShader: Texture_Color.frag
[12.12.2018 19:50:50 | MSG] ES2ResourceFactory: Prism - createStockShader: Texture_LinearGradient_PAD.frag
[12.12.2018 19:50:50 | MSG] PPSRenderer: scenario.effect - createShader: Blend_MULTIPLY
[12.12.2018 19:50:51 | MSG] ES2ResourceFactory: Prism - createStockShader: FillPgram_Color.frag
[12.12.2018 19:50:51 | MSG] new alphas with length = 344064
[12.12.2018 19:51:04 | MSG] QuantumRenderer: shutdown

JDK:

java version "11.0.1" 2018-10-16 LTS
Java(TM) SE Runtime Environment 18.9 (build 11.0.1+13-LTS)
Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.1+13-LTS, mixed mode)

Tested on OpenJFX Versions:

  1. 12-ea+4
  2. 12-ea+2
  3. 11.0.1

OS: elementary OS 5.0 Juno (Ubuntu 18.04 LTS) Graphics Driver: nvidia-390

CPU: I7 8700K GPU: GTX 1060 6GB

I tested it on a 4k screen, though i did changed the resolution to 1920x1800 and got the same result.

I can add as a note that after testing with multiple FXML files as source or simply a Alert, the rendered Size seams to always be the same.

Any Ideas on ways to solve this?

Regards, Liz3

Liz3
  • 145
  • 1
  • 11
  • You say "when run on Ubuntu". Does that mean it renders properly in other architectures? – Perdi Estaquel Dec 13 '18 at 00:39
  • @PerdiEstaquel exactly, the reference image was taken on windows 10 and tests on macOS High Sierra and Mojave also succeeded. + Tests of Fedora are also succeeding. – Liz3 Dec 13 '18 at 00:52

1 Answers1

0

After a lot of testing it turns out its related to the Gtk Version. The used OpenJFX versions where accessing Gtk 3 and as a result created that bug, which could be resolved by calling: stage.initStyle(StageStyle.UNDECORATED).

To actually fix the error its necessary to add the JVM Option: -Djdk.gtk.version=2 which completely solved the problem.

I will do more research on the source and add details here.

Regards, Liz3

Liz3
  • 145
  • 1
  • 11