-
Bug
-
Resolution: Fixed
-
P3
-
jfx11, 9, 10
-
Windows platforms with HiDPI scaling
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8257096 | jfx11.0.10 | Jose Pereda | P3 | Resolved | Fixed |
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 :
Windows 10.0.16299.248
A DESCRIPTION OF THE PROBLEM :
In a simple self-sizing scene, some or all control labels are incorrectly truncated with an ellipsis at DPI levels between 100% and 200%. On 125% and 150%, this appears to be fixed by an explicit call to sizeToScene which however should not be necessary, and was not necessary in Java SE 8u60. On 175%, which is also one of the standard Windows 10 scaling levels, the bug persists regardless of calling sizeToScene.
The bug did not appear in several real applications I checked. It seems that increased layout complexity eventually suppresses the bug. There may be an initial text measuring error that eventually gets corrected by additional layout passes.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Compile below test case and run using -Dglass.win.uiScale=125%, 150%, or 175%. Add parameter "sizeToScene" for calling that method explicitly.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
All control labels should always be fully displayed, as the scene is entirely self-sizing without external constraints.
ACTUAL -
On DPI levels of 125%, 150%, or 175% some or all control labels are truncated with an ellipsis. Explicitly calling sizeToScene fixes this for 125% and 150% but not for 175% where all control labels are still truncated.
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
import javafx.application.*;
import javafx.geometry.*;
import javafx.scene.*;
import javafx.scene.control.*;
import javafx.scene.layout.*;
import javafx.stage.*;
public class ControlLabelTest extends Application {
public static void main(String[] args) {
Application.launch(args);
}
@Override
public void start(Stage stage) {
final HBox box = new HBox();
box.setAlignment(Pos.CENTER);
box.setPadding(new Insets(8));
box.setSpacing(8);
for (int i = 0; i < 4; i++)
box.getChildren().add(new CheckBox("Check"));
stage.setScene(new Scene(box));
if (getParameters().getUnnamed().contains("sizeToScene"))
stage.sizeToScene();
stage.show();
}
}
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
Explicitly calling sizeToScene appears to suppress the bug at DPI levels other than 175%. Otherwise, only an explicit minimum size for the labeled control works reliably.
- backported by
-
JDK-8257096 Control labels truncated at certain DPI scaling levels
- Resolved
- relates to
-
JDK-8257719 JFXPanel scene fails to render correctly on HiDPI after fix for JDK-8199592
- Resolved
-
JDK-8146920 [hidpi] Multi-Monitor issue with HiDpi scaling and undecorated stages
- Resolved
-
JDK-8255415 Nested calls to snap methods in Region give different results
- Resolved
-
JDK-8199204 Scene set after stage shown is not sized correctly with HiDPI scaling
- Closed
-
JDK-8091832 Provide a Screen.getScale method for Hi-DPI screens
- Resolved
-
JDK-8258664 Labels in owned Dialog are truncated when DPI scaling is 125%
- Open