There is a difference between `Processing 4.3 and 4.4.7 (and 4.4.10) in how the default renderer handles Windows scaling.
In Processing 4.3 a sketch with a size(200, 200) the canvas indeed 200x200 pixels; in Processing 4.4.7 it the scaling factor larger (250x250).
I have figured out that I can use the P2D renderer to prevent this (size(200,200, P2D)).
(1) Is there a reason for this (different version of Java maybe or something else).
fullScreen(P2D) in 4.4.10 however shows a rectangle in the left top corner of my screen that is 80% in each direction of what was expected (1920x1080 resolution of the laptop screen).
(2) How do I get that 1920x1080? I can obviously specify that resolution in size() but when I use a different screen I have to adjust again.
Note:
My requirements are simple; I’m not in need fancy graphics, just some rectangles and text.
This is a workaround on my system for fullscreen(P2D) :
/*
* Fullscreen P2D Workaround
*
* Author: glv
* Date: 2025-11-09
*
*/
static
{
// Forces 1:1 pixel rendering by disabling OS-level DPI scaling
System.setProperty("sun.java2d.uiScale", "1.01"); // If this is 1.0 it does NOT work!
//System.setProperty("sun.java2d.DPIscaling", "false"); // No effect.
}
void setup()
{
//size(1920, 1200, P2D);
fullScreen(P2D, 2); // 0 is span, 1 is monitor 1, 2 is monitor 2
println(SPAN);
println(width, height);
//surface.setLocation(50, 50); // Does NOT work with monitor 2 and will go to monitor 1!
}
void draw()
{
// Helps to see the size of the screen:
circle(50, 50, 50);
circle(width-50, 50, 50);
circle(width-50, height-50, 50);
circle(50, height-50, 50);
circle(width/2, height/2, 50);
}
I came across this quite accidentally exploring this a few days ago!
It has to be at least one pixel off to work and you will see this in the println(width, height); output.
It seems to solve all problems with regards to size.
Here are some notes from my code
/*
Selecting the renderer
1.
Default rendering screws me around with windows scaling
2
P2D is OK but maximizing window takes long and circle first changes to ellipse and next to circle when maximizing
Ignores windows scaling :+1:
Places (in left top) without title bar :(
Seems to have jaggered edges around cirles.
3
FX2D does not (easily) allow to align text (vertical align in circle)
Needs trick to suppress windows scaling; that's acceptable
*/
I haven’t found the best way to sort the vertical text alignment out, for now subtract a fixed amount. There was a similar issue in Processing 4.2 that got solved in 4.3; see Processing 4.3 is out! ✨ - #3 by sterretje.
This leaves the first question why there is a difference between Processing 4.3 and the later versions with regards to the default renderer. I know that there is a difference in the java version (checked by running Report System and Environment Diagnostics at Runtime) but I do not know if that is the cause.
The source code for the various versions is also available to you.
I have been modifying the source code for Processing 4.4.10 to create a custom PDE (for my personal use) and using VS Code as the editor and building on the command-line.
I successfully achieved my desired 1:1 scaling by manually setting float uiScale = 1; in one of the source files I was editing. I also noticed that code for displayDensity() and pixelDensity() seems to have been added within that same file and others between versions 4.3.4 and 4.4.0, which suggests that addressing one technical challenge may be affecting other behaviors. I still do not know the full impact and only have monitors with a displayDensity() = 1.
This is just a personal exploration and not intended as an answer to your questions and I am not drawing any conclusions from the above. I am just having my fun and learning along the way!
I certainly understand the challenges the Processing team faces (similar experiences with coding embedded systems) and sincerely appreciate the work they are doing. It is not always so simple.
I will share what I learn with the Processing team.
I’ll have to thank you for your input on this forum As well as some other people here.
I know. The problem is that I do not know the search terms or use the wrong ones; things like renderers, scaling and DPI basically mean nothing to me.
And it annoys me that something looks like intended in an older version of Processing and later changes. I can unfortunately not look in Processing’s kitchen but I don’t understand why things (have to) change.
I use Processing to create simple (or not so simple) user interfaces. Example of the latter is a simulation for a remote control that can communicate with Arduinos. It’s past the alpha stage but still a beta.