Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8267430: GraphicsDevice.setDisplayMode(REFRESH_RATE_UNKNOWN) throws IAE: Unable to set display mode! #4373

wants to merge 4 commits into from
Changes from 1 commit
File filter

Filter by extension

Filter by extension

Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
@@ -34,6 +34,7 @@
import java.awt.Window;
import java.awt.geom.Rectangle2D;
import java.awt.peer.WindowPeer;
import java.util.Arrays;
import java.util.Objects;

import sun.java2d.SunGraphicsEnvironment;
@@ -203,6 +204,7 @@
public void invalidate(CGraphicsDevice device) {
//TODO do we need to restore the full-screen window/modes on old device?
displayID = device.displayID;
initialMode = device.initialMode;

@@ -359,7 +361,22 @@

public DisplayMode[] getDisplayModes() {
return nativeGetDisplayModes(displayID);
DisplayMode[] nativeModes = nativeGetDisplayModes(displayID);
boolean match = false;
for (DisplayMode mode : nativeModes) {
if (initialMode.equals(mode)) {
match = true;
if (match) {
return nativeModes;
} else {
int len = nativeModes.length;
DisplayMode[] modes = Arrays.copyOf(nativeModes, len+1, DisplayMode[].class);
modes[len] = initialMode;
return modes;

Check failure on line 379 in src/java.desktop/macosx/classes/sun/awt/

openjdk / jcheck

Whitespace error

Column 23: trailing whitespace

public static boolean usingMetalPipeline() {