Skip to content

Window creation does not properly handle UI scaling on Linux Mint #3

@rmheuer

Description

@rmheuer

When creating the sketch window, it is not created with the correct size if the system UI scale is set to something other than 100% (for example 2x scale on high-DPI displays).

To reproduce, set system UI scale to 200%, then run the following:

import processing.core.PApplet;
public class SizeCheck extends PApplet {
  @Override
  public void settings() {
    size(800, 800, P2D);
  }

  @Override
  public void setup() {
    println(width + " x " + height);
  }

  public static void main(String[] args) {
    PApplet.main(SizeCheck.class);
  }
}

With libp5x, this results in a 400x400 window and outputs:

The sketch has been automatically resized to fit the screen resolution
OpenGL error 1280 at bot beginDraw(): invalid enumerant
400 x 400

Standard Processing 4 does not have this issue, and correctly creates an 800x800 window, so I'm guessing it's due to using GLFW for window creation here instead of JOGL.

Platform:
OS: Linux Mint 22.1 Cinnamon 64-bit
Java: openjdk version "21.0.8" 2025-07-15
OpenGL vendor: Intel
OpenGL renderer: Mesa Intel(R) UHD Graphics (CML GT2)
OpenGL version: 4.6 (Core Profile) Mesa 25.0.7-0ubuntu0.24.04.2
GLSL version: 4.60

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions