Since I updated to Processing 4.5.6 (on Win 11), every sketch runs okay, but gets the error message:
“display count needs to be implemented for non-AWT
AWT disabled, displayWidth/displayHeight will be 0”
Nothing here: fullScreen(P3D) not fullscreening on Windows or on the pages it links to seems to be helping.
I’m using a fixed display window, size(1080, 1080) without P2D or P3D, with pixelDensity(1)
It doesn’t actually seem to be affecting how the code works, but I wouldn’t mind knowing why this is happening and if it is possible to get rid of it.
Any help very gratefully received by a first-time poster. Thank you.
Take a look at this reference to gain some insight into why this is happening:
This file contains this code:
public int displayDensity() {
if (display != SPAN && (fullScreen || present)) {
return displayDensity(display);
}
int displayCount = 0;
if (!disableAWT) {
displayCount = ShimAWT.getDisplayCount();
} else {
// https://github.com/processing/processing4/issues/57
System.err.println("display count needs to be implemented for non-AWT");
}
// walk through all displays, use 2 if any display is 2
for (int i = 0; i < displayCount; i++) {
if (displayDensity(i+1) == 2) {
return 2;
}
}
// If nobody's density is 2 then everyone is 1
return 1;
}
The error message appears to be thrown because disableAWT is set to true. That occurs here:
case ARGS_DISABLE_AWT:
disableAWT = true;
break;
It apparently was set to true for this reason:
/** Disable AWT so that LWJGL and others can run */ static public final String ARGS_DISABLE_AWT = "--disable-awt";
Note:
I have yet to test out the above in a custom build.
Migrating to a new PC and have other priorities.
I will follow up once I do this… not anytime soon.
Thanks for looking into this. I reported this bug in the issue below back in July, and just added a link to this conversation. Feel free to share your findings in the replies and/or suggest/contribute a fix.
Thanks everyone for your help with this. I’ve added a comment to the issue @sableraph has raised on GitHub noting that the issue is on PCs running Win 11 as well as Macs. I wish I could code well enough to help fix this!