-
Bug
-
Resolution: Not an Issue
-
P3
-
None
-
11.0.5
-
x86
-
linux
ADDITIONAL SYSTEM INFORMATION :
For example Debian 10 using Wayland. Any Java version is affected.
A DESCRIPTION OF THE PROBLEM :
Taking a screenshot or otherwise capture the content of a screen does not work with Wayland - only a plain black screen is captured.
REGRESSION : Last worked in version 8
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Create a screen capture using java.awt.Robot.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
An image of the captured screen.
ACTUAL -
A plain black image.
---------- BEGIN SOURCE ----------
public void captureScreen() throws AWTException {
Robot robot = new Robot(GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice());
BufferedImage screen = robot.createScreenCapture(new Rectangle(getDefaultToolkit().getScreenSize()));
try {
ImageIO.write(screen, "jpg", new File("/tmp/screenshot.jpg"));
} catch (IOException e) {
e.printStackTrace();
}
}
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
None. A Wayland developer commented the following:
This is not a Wayland bug, this is a problem with java.awt.Robot. Report it to the proper place. Let them know that they can take screenshots with dbus or with wlr-screencopy, depending on the wayland compositor in question.
FREQUENCY : always
For example Debian 10 using Wayland. Any Java version is affected.
A DESCRIPTION OF THE PROBLEM :
Taking a screenshot or otherwise capture the content of a screen does not work with Wayland - only a plain black screen is captured.
REGRESSION : Last worked in version 8
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Create a screen capture using java.awt.Robot.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
An image of the captured screen.
ACTUAL -
A plain black image.
---------- BEGIN SOURCE ----------
public void captureScreen() throws AWTException {
Robot robot = new Robot(GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice());
BufferedImage screen = robot.createScreenCapture(new Rectangle(getDefaultToolkit().getScreenSize()));
try {
ImageIO.write(screen, "jpg", new File("/tmp/screenshot.jpg"));
} catch (IOException e) {
e.printStackTrace();
}
}
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
None. A Wayland developer commented the following:
This is not a Wayland bug, this is a problem with java.awt.Robot. Report it to the proper place. Let them know that they can take screenshots with dbus or with wlr-screencopy, depending on the wayland compositor in question.
FREQUENCY : always