简体   繁体   中英

OpenJFX only renders Parts of a Window when run on Ubuntu

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 Correct form as reference(Excluding the two entries in the ListView on the left): 在此处输入图片说明

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM