-
Bug
-
Resolution: Unresolved
-
P4
-
jfx11, 8, 9, 10
-
x86_64
-
linux
FULL PRODUCT VERSION :
openjdk version "1.8.0_151"
OpenJDK Runtime Environment (build 1.8.0_151-8u151-b12-1-b12)
OpenJDK 64-Bit Server VM (build 25.151-b12, mixed mode)
ADDITIONAL OS VERSION INFORMATION :
Linux 4.14.0-3-amd64 #1 SMP Debian 4.14.17-1 (2018-02-14) x86_64 GNU/Linux
A DESCRIPTION OF THE PROBLEM :
Primary screen may be wrong on GTK environments (Linux). The first monitor is always returned, though it may not be the primary one. The effect is that stages always open on the first monitor, which may not be the primary one. This makes JavaFX stand out compared to other applications, which correctly respect the primary monitor.
The root cause seems to be com.sun.glass.ui.Screen.getMainScreen which is implemented as:
return getScreens().get(0);
To remedy this, possibly a method should be added to get the primary monitor (or primary monitor index), which in com.sun.glass.ui.gtk.GtkApplication could be implemented by calling: https://developer.gnome.org/gtkmm/stable/classGdk_1_1Screen.html#a2c5c01fd7b837c41c5258d652cee65d9 (get_primary_monitor) .
Presumably, other frontends return their monitors with the primary monitor always first so this will be needed only for GTK. If not, other implementations may need their own ways of finding the primary monitor.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Use a machine with 2+ monitors, and set any monitor other than the first one to be the primary one. Run any JavaFX application which doesn't explicitly select a screen to start on.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Stages should default to the primary monitor
ACTUAL -
Stages always show on the first monitor, regardless of primary monitor defined.
REPRODUCIBILITY :
This bug can be reproduced always.
CUSTOMER SUBMITTED WORKAROUND :
No workaround is possible, as primary screen selection isn't exposed in public API.
openjdk version "1.8.0_151"
OpenJDK Runtime Environment (build 1.8.0_151-8u151-b12-1-b12)
OpenJDK 64-Bit Server VM (build 25.151-b12, mixed mode)
ADDITIONAL OS VERSION INFORMATION :
Linux 4.14.0-3-amd64 #1 SMP Debian 4.14.17-1 (2018-02-14) x86_64 GNU/Linux
A DESCRIPTION OF THE PROBLEM :
Primary screen may be wrong on GTK environments (Linux). The first monitor is always returned, though it may not be the primary one. The effect is that stages always open on the first monitor, which may not be the primary one. This makes JavaFX stand out compared to other applications, which correctly respect the primary monitor.
The root cause seems to be com.sun.glass.ui.Screen.getMainScreen which is implemented as:
return getScreens().get(0);
To remedy this, possibly a method should be added to get the primary monitor (or primary monitor index), which in com.sun.glass.ui.gtk.GtkApplication could be implemented by calling: https://developer.gnome.org/gtkmm/stable/classGdk_1_1Screen.html#a2c5c01fd7b837c41c5258d652cee65d9 (get_primary_monitor) .
Presumably, other frontends return their monitors with the primary monitor always first so this will be needed only for GTK. If not, other implementations may need their own ways of finding the primary monitor.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Use a machine with 2+ monitors, and set any monitor other than the first one to be the primary one. Run any JavaFX application which doesn't explicitly select a screen to start on.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Stages should default to the primary monitor
ACTUAL -
Stages always show on the first monitor, regardless of primary monitor defined.
REPRODUCIBILITY :
This bug can be reproduced always.
CUSTOMER SUBMITTED WORKAROUND :
No workaround is possible, as primary screen selection isn't exposed in public API.