-
Bug
-
Resolution: Unresolved
-
P4
-
11, 17, 21
The javadoc for the java.awt.SystemTray.getTrayIconSize method states:
“Returns the size, *in pixels*, of the space that a tray icon will occupy in the system tray.”
It is not quite correct. On a High DPI screen with scale of 200%, the icon will be 32×32 on Windows. Yet the method always returns 16×16.
The scale of the main display on macOS isn't taken into account either.
The spec should be updated to clarify the size is user space / logical pixels.
A simple reproducer:
import java.awt.SystemTray;
public class SysTrayIconSize {
public static void main(String[] args) {
System.out.println(SystemTray.getSystemTray().getTrayIconSize());
}
}
“Returns the size, *in pixels*, of the space that a tray icon will occupy in the system tray.”
It is not quite correct. On a High DPI screen with scale of 200%, the icon will be 32×32 on Windows. Yet the method always returns 16×16.
The scale of the main display on macOS isn't taken into account either.
The spec should be updated to clarify the size is user space / logical pixels.
A simple reproducer:
import java.awt.SystemTray;
public class SysTrayIconSize {
public static void main(String[] args) {
System.out.println(SystemTray.getSystemTray().getTrayIconSize());
}
}
- duplicates
-
JDK-8315978 The size of SystemTray always returns 24X24px in linux
-
- Closed
-
- relates to
-
JDK-8315978 The size of SystemTray always returns 24X24px in linux
-
- Closed
-