Display count needs to be implemented for non-AWT

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.

I’m experiencing the same issue. I upgraded from 4.5.5 to 4.5.6, and even the simplest code triggers the warning.

I also use secondary window functionality, and the warning appears every time a secondary window is called.

I’ve reverted to 4.5.5 for now because I capture system output to log, and the repeated warnings are flooding my logs.

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";

Hello @AlexRussell,

Try this in a sketch:
println("disableAWT: ", disableAWT); // true for 4.5.6 and false for 4.5.5

This was (below) added to Processing 4.5.6 and it is NOT in 4.5.5:

It now checks the argument at startup and displays the errors unconditionally in 4.5.6 that you see.

Trail of breadcrumbs:

You can also make a custom version of Processing!

processing4/BUILD.md at main · processing/processing4 · GitHub

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!