JDK-8198761 : [linux] setResizeable on Stage causes the window to become unusable
  • Type: Bug
  • Component: javafx
  • Sub-Component: window-toolkit
  • Affected Version: 9.0.4
  • Priority: P4
  • Status: Open
  • Resolution: Unresolved
  • OS: linux
  • CPU: x86_64
  • Submitted: 2018-02-27
  • Updated: 2018-09-05
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.
Other
tbdUnresolved
Description
FULL PRODUCT VERSION :
java version "9.0.4"
Java(TM) SE Runtime Environment (build 9.0.4+11)
Java HotSpot(TM) 64-Bit Server VM (build 9.0.4+11, mixed mode)



ADDITIONAL OS VERSION INFORMATION :
Linux depsn116.inaf.cnrs-gif.fr 4.15.5-1-default #1 SMP PREEMPT Thu Feb 22 21:48:29 UTC 2018 (52ce732) x86_64 x86_64 x86_64 GNU/Linux


EXTRA RELEVANT SYSTEM CONFIGURATION :
OpenSuSE Tumbleweed
KDE desktop
Using Scala 2.12.4

A DESCRIPTION OF THE PROBLEM :
When using the setResizable function on the primary stage, the stage becomes unviewably small. The elements within are not visible, and neither are window decorations and close buttons. I've attached minimal reproducible code here: https://pastebin.com/dmhJqfrT

Here are some images of what's happening on my desktop with a JavaFX9 application I'm developing. 

setResizable(true): 

https://i.imgur.com/k41vU25.png

setResizable(false):

https://i.imgur.com/p8rIPHi.png


REGRESSION.  Last worked in version 8u162

ADDITIONAL REGRESSION INFORMATION: 
java version "1.8.0_162"
Java(TM) SE Runtime Environment (build 1.8.0_162-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.162-b12, mixed mode)


STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
set the primary stage to unresizable.

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
The maximize button should disappear and the stage should not be resizable, but be the appropriate size for its content.

Something kind of like this:
https://i.imgur.com/k41vU25.png
ACTUAL -
The maximize and all other windowing buttons disappear, and while the stage is not resizable, it's also not big enough to display ANY of it's content

https://i.imgur.com/p8rIPHi.png

ERROR MESSAGES/STACK TRACES THAT OCCUR :
There are no error messages

REPRODUCIBILITY :
This bug can be reproduced always.

---------- BEGIN SOURCE ----------
import javafx.application.{Application => JavaFXApplication}
import javafx.scene.Scene
import javafx.scene.layout.Pane
import javafx.scene.control.Button
import javafx.stage.Stage
 
class SetResizableExample extends JavaFXApplication {
  override def start(primaryStage: Stage): Unit = {
    primaryStage.setTitle("SuperCopyMan 2")
    val pane = new Pane()
    val button = new Button("click me")
 
    pane.getChildren.add(button)
 
    val scene = new Scene(pane, 500, 400)
    primaryStage.setScene(scene)
    primaryStage.setResizable(false)
    primaryStage.show()
 
  }
}
 
object SetResizableExample {
  def main(args: Array[String]): Unit = {
    JavaFXApplication.launch(classOf[SetResizableExample])
  }
}
---------- END SOURCE ----------

CUSTOMER SUBMITTED WORKAROUND :
None. I have tried using stage.sizeToScene() and it has no effect whatsoever.


Comments
Additional information from Submitter: ---------------------------------------------------------- I have confirmed, on my system on Ubuntu 16.04, the issue is not present. This seems to be an issue with regards to the KDE window manager. However, this is not an issue that was present in java 8. This behavior only happens on java 9+ on my kde system. ----------------------------------------------------------
05-03-2018

Additional information from Submitter: ------------------------------------------ I will try this in ubuntu 16.04 like you suggested earlier. In the meantime, I have tested with jdk 9, 10, and 11 using the -Djdk.gtk.verbose=true -Djdk.gtk.version=3 options you suggested. Here's the output from all three runs: jdk9 ------ [info] Running (fork) SetResizableExample [info] Prism pipeline init order: es2 sw [info] Using java-based Pisces rasterizer [info] Using dirty region optimizations [info] Not using texture mask for primitives [info] Not forcing power of 2 sizes for textures [info] Using hardware CLAMP_TO_ZERO mode [info] Opting in for HiDPI pixel scaling [info] Prism pipeline name = com.sun.prism.es2.ES2Pipeline [info] Loading ES2 native library ... prism_es2 [info] succeeded. [info] GLFactory using com.sun.prism.es2.X11GLFactory [error] No protocol specified [info] (X) Got class = class com.sun.prism.es2.ES2Pipeline [info] Initialized prism pipeline: com.sun.prism.es2.ES2Pipeline [error] No protocol specified [info] checking GTK version 3 [info] trying GTK library libgtk-3.so.0 [info] using GTK library version 3 set libgtk-3.so.0 [info] Glass GTK library to load is glassgtk3 [error] No protocol specified [error] No protocol specified [error] loaded gdk_x11_display_set_window_scale [error] loaded g_settings_schema_source_get_default [error] loaded g_settings_schema_source_lookup [error] loaded g_settings_schema_has_key [error] found schema 'org.gnome.desktop.interface' and key 'scaling-factor' [error] loaded g_settings_schema_unref [error] found schema 'org.gnome.desktop.interface' and key 'scaling-factor' [error] No protocol specified [info] Maximum supported texture size: 16384 [info] Maximum texture size clamped to 4096 [info] Non power of two texture support = true [info] Maximum number of vertex attributes = 16 [info] Maximum number of uniform vertex components = 16384 [info] Maximum number of uniform fragment components = 16384 [info] Maximum number of varying components = 128 [info] Maximum number of texture units usable in a vertex shader = 32 [info] Maximum number of texture units usable in a fragment shader = 32 [info] Graphics Vendor: Intel Open Source Technology Center [info] Renderer: Mesa DRI Intel(R) Haswell Mobile [info] Version: 3.0 Mesa 18.0.0-rc4 [error] vsync: true vpipe: true [error] No protocol specified [info] ES2ResourceFactory: Prism - createStockShader: FillPgram_Color.frag [info] new alphas [info] ES2ResourceFactory: Prism - createStockShader: Texture_Color.frag [info] ES2ResourceFactory: Prism - createStockShader: Texture_LinearGradient_PAD.frag [info] ES2ResourceFactory: Prism - createStockShader: Solid_TextureRGB.frag [info] ES2ResourceFactory: Prism - createStockShader: Solid_TextureFirstPassLCD.frag [info] ES2ResourceFactory: Prism - createStockShader: Solid_TextureSecondPassLCD.frag jdk10 -------- [info] Running (fork) SetResizableExample [info] Prism pipeline init order: es2 sw [info] Using Double Precision Marlin Rasterizer [info] Using dirty region optimizations [info] Not using texture mask for primitives [info] Not forcing power of 2 sizes for textures [info] Using hardware CLAMP_TO_ZERO mode [info] Opting in for HiDPI pixel scaling [info] Prism pipeline name = com.sun.prism.es2.ES2Pipeline [info] Loading ES2 native library ... prism_es2 [info] succeeded. [info] GLFactory using com.sun.prism.es2.X11GLFactory [error] No protocol specified [info] (X) Got class = class com.sun.prism.es2.ES2Pipeline [info] Initialized prism pipeline: com.sun.prism.es2.ES2Pipeline [error] No protocol specified [info] checking GTK version 3 [info] trying GTK library libgtk-3.so.0 [info] using GTK library version 3 set libgtk-3.so.0 [info] Glass GTK library to load is glassgtk3 [error] No protocol specified [error] No protocol specified [error] loaded gdk_x11_display_set_window_scale [error] loaded g_settings_schema_source_get_default [error] loaded g_settings_schema_source_lookup [error] loaded g_settings_schema_has_key [error] found schema 'org.gnome.desktop.interface' and key 'scaling-factor' [error] loaded g_settings_schema_unref [error] found schema 'org.gnome.desktop.interface' and key 'scaling-factor' [error] No protocol specified [info] Maximum supported texture size: 16384 [info] Maximum texture size clamped to 4096 [info] Non power of two texture support = true [info] Maximum number of vertex attributes = 16 [info] Maximum number of uniform vertex components = 16384 [info] Maximum number of uniform fragment components = 16384 [info] Maximum number of varying components = 128 [info] Maximum number of texture units usable in a vertex shader = 32 [info] Maximum number of texture units usable in a fragment shader = 32 [info] Graphics Vendor: Intel Open Source Technology Center [info] Renderer: Mesa DRI Intel(R) Haswell Mobile [info] Version: 3.0 Mesa 18.0.0-rc4 [error] vsync: true vpipe: true [error] No protocol specified [info] ES2ResourceFactory: Prism - createStockShader: FillPgram_Color.frag [info] new alphas with length = 4096 [info] ES2ResourceFactory: Prism - createStockShader: Texture_Color.frag [info] ES2ResourceFactory: Prism - createStockShader: Texture_LinearGradient_PAD.frag [info] ES2ResourceFactory: Prism - createStockShader: Solid_TextureRGB.frag [info] ES2ResourceFactory: Prism - createStockShader: Solid_TextureFirstPassLCD.frag [info] ES2ResourceFactory: Prism - createStockShader: Solid_TextureSecondPassLCD.frag jdk11 -------- [info] Running (fork) SetResizableExample [info] Prism pipeline init order: es2 sw [info] Using Double Precision Marlin Rasterizer [info] Using dirty region optimizations [info] Not using texture mask for primitives [info] Not forcing power of 2 sizes for textures [info] Using hardware CLAMP_TO_ZERO mode [info] Opting in for HiDPI pixel scaling [info] Prism pipeline name = com.sun.prism.es2.ES2Pipeline [info] Loading ES2 native library ... prism_es2 [info] succeeded. [info] GLFactory using com.sun.prism.es2.X11GLFactory [error] No protocol specified [info] (X) Got class = class com.sun.prism.es2.ES2Pipeline [info] Initialized prism pipeline: com.sun.prism.es2.ES2Pipeline [error] No protocol specified [info] checking GTK version 3 [info] trying GTK library libgtk-3.so.0 [info] using GTK library version 3 set libgtk-3.so.0 [info] Glass GTK library to load is glassgtk3 [error] No protocol specified [error] No protocol specified [error] loaded gdk_x11_display_set_window_scale [error] loaded g_settings_schema_source_get_default [error] loaded g_settings_schema_source_lookup [error] loaded g_settings_schema_has_key [error] found schema 'org.gnome.desktop.interface' and key 'scaling-factor' [error] loaded g_settings_schema_unref [error] found schema 'org.gnome.desktop.interface' and key 'scaling-factor' [error] No protocol specified [info] Maximum supported texture size: 16384 [info] Maximum texture size clamped to 4096 [info] Non power of two texture support = true [info] Maximum number of vertex attributes = 16 [info] Maximum number of uniform vertex components = 16384 [info] Maximum number of uniform fragment components = 16384 [info] Maximum number of varying components = 128 [info] Maximum number of texture units usable in a vertex shader = 32 [info] Maximum number of texture units usable in a fragment shader = 32 [info] Graphics Vendor: Intel Open Source Technology Center [info] Renderer: Mesa DRI Intel(R) Haswell Mobile [info] Version: 3.0 Mesa 18.0.0-rc4 [error] vsync: true vpipe: true [error] No protocol specified [info] ES2ResourceFactory: Prism - createStockShader: FillPgram_Color.frag [info] new alphas with length = 4096 [info] ES2ResourceFactory: Prism - createStockShader: Texture_Color.frag [info] ES2ResourceFactory: Prism - createStockShader: Texture_LinearGradient_PAD.frag [info] ES2ResourceFactory: Prism - createStockShader: Solid_TextureRGB.frag [info] ES2ResourceFactory: Prism - createStockShader: Solid_TextureFirstPassLCD.frag [info] ES2ResourceFactory: Prism - createStockShader: Solid_TextureSecondPassLCD.frag I get the same issue with gtk2. Here is the output for jdk 9,10,and 11 with gtk forced to version 2: jdk9 -------- [info] Running (fork) SetResizableExample [info] Prism pipeline init order: es2 sw [info] Using java-based Pisces rasterizer [info] Using dirty region optimizations [info] Not using texture mask for primitives [info] Not forcing power of 2 sizes for textures [info] Using hardware CLAMP_TO_ZERO mode [info] Opting in for HiDPI pixel scaling [info] Prism pipeline name = com.sun.prism.es2.ES2Pipeline [info] Loading ES2 native library ... prism_es2 [info] succeeded. [info] GLFactory using com.sun.prism.es2.X11GLFactory [error] No protocol specified [info] (X) Got class = class com.sun.prism.es2.ES2Pipeline [info] Initialized prism pipeline: com.sun.prism.es2.ES2Pipeline [error] No protocol specified [info] checking GTK version 2 [info] trying GTK library libgtk-x11-2.0.so.0 [info] using GTK library version 2 set libgtk-x11-2.0.so.0 [info] Glass GTK library to load is glassgtk2 [error] No protocol specified [error] loaded g_settings_schema_source_get_default [error] loaded g_settings_schema_source_lookup [error] loaded g_settings_schema_has_key [error] found schema 'org.gnome.desktop.interface' and key 'scaling-factor' [error] loaded g_settings_schema_unref [error] found schema 'org.gnome.desktop.interface' and key 'scaling-factor' [error] No protocol specified [info] Maximum supported texture size: 16384 [info] Maximum texture size clamped to 4096 [info] Non power of two texture support = true [info] Maximum number of vertex attributes = 16 [info] Maximum number of uniform vertex components = 16384 [info] Maximum number of uniform fragment components = 16384 [info] Maximum number of varying components = 128 [info] Maximum number of texture units usable in a vertex shader = 32 [info] Maximum number of texture units usable in a fragment shader = 32 [info] Graphics Vendor: Intel Open Source Technology Center [info] Renderer: Mesa DRI Intel(R) Haswell Mobile [info] Version: 3.0 Mesa 18.0.0-rc4 [error] vsync: true vpipe: true [error] No protocol specified [info] ES2ResourceFactory: Prism - createStockShader: FillPgram_Color.frag [info] new alphas [info] ES2ResourceFactory: Prism - createStockShader: Texture_Color.frag [info] ES2ResourceFactory: Prism - createStockShader: Texture_LinearGradient_PAD.frag [info] ES2ResourceFactory: Prism - createStockShader: Solid_TextureRGB.frag [info] ES2ResourceFactory: Prism - createStockShader: Solid_TextureFirstPassLCD.frag [info] ES2ResourceFactory: Prism - createStockShader: Solid_TextureSecondPassLCD.frag jdk10 -------- [info] Running (fork) SetResizableExample [info] Prism pipeline init order: es2 sw [info] Using Double Precision Marlin Rasterizer [info] Using dirty region optimizations [info] Not using texture mask for primitives [info] Not forcing power of 2 sizes for textures [info] Using hardware CLAMP_TO_ZERO mode [info] Opting in for HiDPI pixel scaling [info] Prism pipeline name = com.sun.prism.es2.ES2Pipeline [info] Loading ES2 native library ... prism_es2 [info] succeeded. [info] GLFactory using com.sun.prism.es2.X11GLFactory [error] No protocol specified [info] (X) Got class = class com.sun.prism.es2.ES2Pipeline [info] Initialized prism pipeline: com.sun.prism.es2.ES2Pipeline [error] No protocol specified [info] checking GTK version 2 [info] trying GTK library libgtk-x11-2.0.so.0 [info] using GTK library version 2 set libgtk-x11-2.0.so.0 [info] Glass GTK library to load is glassgtk2 [error] No protocol specified [error] loaded g_settings_schema_source_get_default [error] loaded g_settings_schema_source_lookup [error] loaded g_settings_schema_has_key [error] found schema 'org.gnome.desktop.interface' and key 'scaling-factor' [error] loaded g_settings_schema_unref [error] found schema 'org.gnome.desktop.interface' and key 'scaling-factor' [error] No protocol specified [info] Maximum supported texture size: 16384 [info] Maximum texture size clamped to 4096 [info] Non power of two texture support = true [info] Maximum number of vertex attributes = 16 [info] Maximum number of uniform vertex components = 16384 [info] Maximum number of uniform fragment components = 16384 [info] Maximum number of varying components = 128 [info] Maximum number of texture units usable in a vertex shader = 32 [info] Maximum number of texture units usable in a fragment shader = 32 [info] Graphics Vendor: Intel Open Source Technology Center [info] Renderer: Mesa DRI Intel(R) Haswell Mobile [info] Version: 3.0 Mesa 18.0.0-rc4 [error] vsync: true vpipe: true [error] No protocol specified [info] ES2ResourceFactory: Prism - createStockShader: FillPgram_Color.frag [info] new alphas with length = 4096 [info] ES2ResourceFactory: Prism - createStockShader: Texture_Color.frag [info] ES2ResourceFactory: Prism - createStockShader: Texture_LinearGradient_PAD.frag [info] ES2ResourceFactory: Prism - createStockShader: Solid_TextureRGB.frag [info] ES2ResourceFactory: Prism - createStockShader: Solid_TextureFirstPassLCD.frag [info] ES2ResourceFactory: Prism - createStockShader: Solid_TextureSecondPassLCD.frag jdk11 --------- [info] Running (fork) SetResizableExample [info] Prism pipeline init order: es2 sw [info] Using Double Precision Marlin Rasterizer [info] Using dirty region optimizations [info] Not using texture mask for primitives [info] Not forcing power of 2 sizes for textures [info] Using hardware CLAMP_TO_ZERO mode [info] Opting in for HiDPI pixel scaling [info] Prism pipeline name = com.sun.prism.es2.ES2Pipeline [info] Loading ES2 native library ... prism_es2 [info] succeeded. [info] GLFactory using com.sun.prism.es2.X11GLFactory [error] No protocol specified [info] (X) Got class = class com.sun.prism.es2.ES2Pipeline [info] Initialized prism pipeline: com.sun.prism.es2.ES2Pipeline [error] No protocol specified [info] checking GTK version 2 [info] trying GTK library libgtk-x11-2.0.so.0 [info] using GTK library version 2 set libgtk-x11-2.0.so.0 [info] Glass GTK library to load is glassgtk2 [error] No protocol specified [error] loaded g_settings_schema_source_get_default [error] loaded g_settings_schema_source_lookup [error] loaded g_settings_schema_has_key [error] found schema 'org.gnome.desktop.interface' and key 'scaling-factor' [error] loaded g_settings_schema_unref [error] found schema 'org.gnome.desktop.interface' and key 'scaling-factor' [error] No protocol specified [info] Maximum supported texture size: 16384 [info] Maximum texture size clamped to 4096 [info] Non power of two texture support = true [info] Maximum number of vertex attributes = 16 [info] Maximum number of uniform vertex components = 16384 [info] Maximum number of uniform fragment components = 16384 [info] Maximum number of varying components = 128 [info] Maximum number of texture units usable in a vertex shader = 32 [info] Maximum number of texture units usable in a fragment shader = 32 [info] Graphics Vendor: Intel Open Source Technology Center [info] Renderer: Mesa DRI Intel(R) Haswell Mobile [info] Version: 3.0 Mesa 18.0.0-rc4 [error] vsync: true vpipe: true [error] No protocol specified [info] ES2ResourceFactory: Prism - createStockShader: FillPgram_Color.frag [info] new alphas with length = 4096 [info] ES2ResourceFactory: Prism - createStockShader: Texture_Color.frag [info] ES2ResourceFactory: Prism - createStockShader: Texture_LinearGradient_PAD.frag [info] ES2ResourceFactory: Prism - createStockShader: Solid_TextureRGB.frag [info] ES2ResourceFactory: Prism - createStockShader: Solid_TextureFirstPassLCD.frag [info] ES2ResourceFactory: Prism - createStockShader: Solid_TextureSecondPassLCD.frag ------------------------------------------
28-02-2018

Could not reproduce the issue on Windows 10 and Ubuntu 16.04 using JDK 9.0.4+11. PFA screenshot of test app in Ubuntu - SetResizableExample_scala_9.0.4+11.png When ran the test case, Stage window maximize button disappeared and window is not re-sizable as expected. When set setResizable(true), maximize button was visible and window was re-sizable. sbt about [info] Loading project definition from /home/priyanka/JI/Scala_project/project [info] Set current project to scala_project (in build file:/home/priyanka/JI/Scala_project/) [info] This is sbt 1.1.1 [info] The current project is ProjectRef(uri("file:/home/priyanka/JI/Scala_project/"), "scala_project") 0.1.0-SNAPSHOT [info] The current project is built against Scala 2.12.4
27-02-2018