JDK-8159892 : [GTK3] invalid rendering of FX app stage in case of scaling
  • Type: Bug
  • Component: javafx
  • Sub-Component: graphics
  • Affected Version: 9
  • Priority: P2
  • Status: Resolved
  • Resolution: Fixed
  • OS: linux_ubuntu
  • Submitted: 2016-06-20
  • Updated: 2016-08-15
  • Resolved: 2016-08-11
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
Duplicate :  
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Description
JDK9 b122 + Ubuntu 16.04 Linux (Unity) + HiDPI (scale = 2).

Please run the attached test code (just one of the ensemble demos).

The rendering is invalid - see "NOK" screenshot.
+ cannot hit into the buttons when trying to click


The issue is also reproducible in case of non-HiDPI display
Comments
http://hg.openjdk.java.net/openjfx/9-dev/rt/rev/3c30e8ccc650
11-08-2016

+1
11-08-2016

I didn't the first time, but I just tried the test program attached to this bug with GDK_SCALE=2 and it works correctly. I note that I ran it on an OL 7 machine in a lab whose DISPLAY was set back to my Ubuntu desktop. The package lists this as the version: 3.8.8-5.el7 I guess this corresponds to 3.8 from an API perspective. +1 on version .02
11-08-2016

Fixed the missing \n on some printfs and more minor formatting consistencies: http://cr.openjdk.java.net/~flar/JDK-8159892/webrev.02/ @Kevin - Did you verify that we work fine with a scale factor and GTK3 on Oracle Linux 7? Also, what version of libgtk does it have?
11-08-2016

By way of follow-up I can confirm that making set_window_scale optional is working, and is necessary in order to run on Oracle Linux 7. When I run there (and instrument the code) I see this: missing optional gdk_x11_display_set_window_scale missing 1 optional gdk symbolsusing GTK library set libgtk-3.so.0, libgdk-3.so.0, libgdk_pixbuf-2.0.so.0 found g_settings_schema_source_get_default = 0x7fecb53185c0 found g_settings_schema_source_lookup = 0x7fecb5318670 did not find g_settings_schema_has_key found g_settings_new = 0x7fecb531b9f0 found g_settings_get_uint = 0x7fecb531c8f0 missing 1 optional gio symbols The FX app runs correctly. As an aside, it looks like you are missing a '\n' on the debug print statment: fprintf (stderr, "missing %d optional gdk symbols", symbol_load_missing);
11-08-2016

I just added Dave, he wasn't on the watch list previously...
10-08-2016

I verified that it still works fine on Ubuntu 14.04 as above. +1 (but Dave should review the dlsym changes)
10-08-2016

New webrev that makes the presence of the new set_window_scale optional and does nothing if it is not found in the library. Note that GTK3 did not do automatic scaling before this function was introduced so if we don't find it then it is OK to ignore it... http://cr.openjdk.java.net/~flar/JDK-8159892/webrev.01/ (I also made a minor change to the optional load macros in the gio wrappers to match what I had done with the optional GDK wrappers, but it only affects wrapper_debug printed output...)
10-08-2016

It looks like this new function is only in 3.10, but the newest functions we've been assuming prior to this are in 3.2 so we should probably make its presence optional and deal with what happens if the function isn't found in the GTK3 library (via dlsym)...
10-08-2016

The fix looks good to me. I tested it on Ubuntu 14.04 by forcing GTK 3 and setting GDK_SCALE=2. +1
10-08-2016

This seems like a fine bug ID to use, although it might be better to change "Ubuntu 16.04:" in the title to "[GTK3]" to better represent the problem.
10-08-2016

webrev: http://cr.openjdk.java.net/~flar/JDK-8159892/webrev.00/ It looks like there is a simple way of disabling automatic scaling for GTK3 so we can do our own (which has been working fairly well so far for GTK2 and is preferable to the integer-operation scaling we'd get automatically via the integer-dominated APIs of GDK/GTK). Questions: - Is this the best bug ID to use for this fix? I used it as it was the first one that I looked at and it had screen shots of the problem that immediately pointed me to the underlying problem. Other bugids are mentioned here as being "possible dups" (and some of them point to still more bugs) and most of them should be a duplicate, but so far I've only tested the test case shown in the screen shots of this bug... - The new function is specifically in 3.10 of the GTK 3 libraries. Should I add additional protections in case a system has an earlier 3.XX version of GTK3? - Minor note - I discovered after publishing the webrev that the function is defined, declared, loaded and stubbed in inconsistent locations in the list of functions - not really an issue, but I'll try to normalize where it appears in all of the various function lists if I have to recut the webrev...
10-08-2016

looking more carefully, it seems to be a duplicate for JDK-8156981: "... lays itself out in the lower left 1/4 of the window, which is what you might expect if we are told the window is half the width and height that we'd asked for" - exactly what happens here.
22-06-2016

another example - AdvancedStageSample from the Ensemble (please see "NOK-2": artifacts selected + can't hit the buttons)
21-06-2016

the scale was set using system settings ("Display"). but the use of GDK_SCALE gives the similar result
20-06-2016