JDK-8171976 : Linux: JavaFX window not painted with background when using GTK 3
  • Type: Bug
  • Component: javafx
  • Sub-Component: window-toolkit
  • Affected Version: 9
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2016-12-23
  • Updated: 2017-01-25
  • Resolved: 2017-01-25
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 9
9Fixed
Related Reports
Relates :  
Description
To reproduce, run Ensemble with GTK 3 on Ubuntu (I used 14.04) :

$ java -Djdk.gtk.version=3 -Djdk.gtk.verbose=true -jar Ensemble8.jar

The window will initially be shown without anything being painted in the background. You will see some leftover garbage from earlier. After a brief pause, the Stage will be rendered with the content of the scene.

This does not happen with GTK 2.

One other observation is that this used to happen only very rarely on my system. Starting with the fix for JDK-8088179 it now happens 100% of the time. This suggests that we may be mishandling the background color in the gtk3 case.
Comments
Changeset: f712021de3ce Author: ssadetsky Date: 2017-01-24 19:08 -0500 URL: http://hg.openjdk.java.net/openjfx/9-dev/rt/rev/f712021de3ce 8171976: Linux: JavaFX window not painted with background when using GTK 3 Reviewed-by: kcr, ddhill ! modules/javafx.graphics/src/main/native-glass/gtk/glass_general.cpp ! modules/javafx.graphics/src/main/native-glass/gtk/glass_window.cpp
25-01-2017

+1
24-01-2017

+1
23-01-2017

Using low level gdk_window_set_background_rgba() instead of widget level call eliminates the issue. http://cr.openjdk.java.net/~ssadetsky/8171976/webrev.00/
23-01-2017

Quantum reacts with a lag on the initial window expose event, so the user sees an empty window at very first instants of its life. In case of GTK2 the window is cleared by white background. But for some reason GTK3 leaves the window as is without filling it with any background color. And it seems the window buffer is created as a copy of the screen root window buffer, that can explains why window shows this odd content initially.
23-01-2017