簡體   English   中英

OpenJFX僅在Ubuntu上運行時才渲染窗口的一部分

[英]OpenJFX only renders Parts of a Window when run on Ubuntu

編輯:

經過對選項的測試后,發現在舞台上調用: stage.initStyle(StageStyle.UNDECORATED)可以解決此問題,即窗口未顯示,但窗口沒有控件。 這意味着它可能與窗口管理器和控件有關。

原版的:

我正在使用使用FXML加載程序從FXML文件加載的場景開始JavaFX Stage。

這是一個很奇怪的問題,因為沒有顯示異常或其他形式的錯誤。 現在,僅渲染一部分窗口,如下所示: 這是錯誤渲染的窗口

這里是正確的形式作為參考(不包括左側ListView中的兩個條目): 在此處輸入圖片說明

由於我沒有收到任何錯誤,因此我只能添加可能有助於解決問題的信息。

-Dprism.verbose=true輸出:

[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)

在OpenJFX版本上測試:

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

操作系統: elementary OS 5.0 Juno (Ubuntu 18.04 LTS)圖形驅動程序: nvidia-390

CPU: I7 8700K GPU: GTX 1060 6GB

我在4k屏幕上進行了測試,盡管我確實將分辨率更改為1920x1800,並獲得了相同的結果。

我可以補充一點,在使用多個FXML文件作為源或僅使用Alert進行測試之后, 呈現的Size接縫始終是相同的

關於解決此問題的任何想法?

此致Liz3

經過大量測試,結果證明它與Gtk版本有關。 使用的OpenJFX版本在訪問Gtk 3時創建了該bug,可以通過調用以下stage.initStyle(StageStyle.UNDECORATED)來解決: stage.initStyle(StageStyle.UNDECORATED)

要真正解決該錯誤,必須添加JVM Option: -Djdk.gtk.version=2 ,這可以完全解決該問題。

我將對源進行更多研究,並在此處添加詳細信息。

此致Liz3

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM