Skip to content

Display detection fails in Processing 4.5.6 on macOS + pixelDensity() #1551

Description

@SableRaf

Most appropriate sub-area of Processing 4?

Core/Environment/Rendering

Processing version

4.5.6

Operating system

macOS Tahoe 26.5.2 (25F84)

Bug description

Running an empty sketch in Processing 4.5.6 produces the following warnings:

display count needs to be implemented for non-AWT
AWT disabled, displayWidth/displayHeight will be 0

Additionally, calling pixelDensity(2) produces this error:

pixelDensity(2) is not available for this display

Processing should detect the display dimensions and use pixelDensity(2) by default on the built-in Retina display.

Regression for:

Steps to reproduce this

  1. Install Processing 4.5.6 on macOS.
  2. Open Processing and create a new sketch.
  3. Run the sketch below.
  4. Observe the display-count and displayWidth/displayHeight warnings in the console.
  5. Uncomment pixelDensity(2).
  6. Run the sketch again.
  7. Observe the pixelDensity(2) is not available for this display error.

snippet

void setup(){
  size(640,400);
  //pixelDensity(2);
}

void draw(){
  line(10,10,630,390);
}

Additional context

Image

Would you like to work on the issue?

No, I’m just reporting the issue

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions