-
-
Notifications
You must be signed in to change notification settings - Fork 85
Description
Most appropriate sub-area of Processing 4?
Core/Environment/Rendering
Processing version
4.3 and 4.3.1
Operating system
Window 11, with Nvidia RTXA4000
Steps to reproduce this
"1. I use Processing 4.3 and 4.3.1. I find that I cannot resize the
Processing window if I use Java2D as the renderer. This situation does
not always happen. After many tests on different machines, I find that it
specifically happens under this settings: "Window + desktop + with
Nvidia graphic card". The problem does not happen on notebook with
Nvidia card and not happen on Mac. I believe that the Java2D renderer
has certain problem to work with the high-end graphic card (e.g. Nvidia
RTX A4000 which is the GPU on my PC desktop ). Running the following
sample program and resize the window can let you experience the problem
(but the problem only happened by running it in window desktop with high end Nvidia card)
-
I find that the problem can be eased (but not solved) if I change the
frameRate() to '1' during window resize and resume it back to "60" after
resize. Then the window sometimes can be resize without problem but not
every time. I tried many other approaches but all of them not working.
By the way, if I use other renderer like P2D, OpenGL, this problem does
not exist. For example, changing the renderer to P2D in the following sample program
and run it again in my PC desktop, I can resize the window without problem. -
I sincerely hope that the development team can handle this bug in the
new release of Processing. I am now relying Processing to build a
software with multiple window and this problem gives me a lot of
inconvenience which is not a problem that i am capable to solve from my
side. The scale of my software is too big and not possible to change the
renderer to others. Thus I hope your team can try solving this issues in the new version
in future. If you need any more information please let me know. Many thanks in
advance.
"
snippet
// Paste your code below :)
int i=0;
void setup()
{
size(800, 600);
surface.setResizable(true);
}
void draw()
{
background(i%256);
i++;
line(0, 0, width, height);
line(width, 0, 0, height);
}
Additional context
No response
Would you like to work on the issue?
yes, i can try
Activity
MartinTheSun commentedon Jan 20, 2025
For more information, the following is the specification of my PC. My PC is just one example to have this problem. I know three more cases which all include Window desktop with high-end Nvidia GPU (e.g. Nvidia GeForce RTX4070 EX GAMER WHITE 12GB GDDR6X in one of those cases).
Stefterv commentedon Jan 20, 2025
2025-01-20.11-05-47.mp4
Is this an accurate recording of the issue you are having?
Stefterv commentedon Jan 20, 2025
I see this on a VM without a graphics card as well so doesn't seem connected to the graphics drivers / card directly
[-]reporting a bug for Processing, related with Java2D and graphic card conflict[/-][+]Sketch Window Resizing Issues with Java2D Renderer on Windows [/+]MartinTheSun commentedon Jan 21, 2025
yes, if the problem happens, it happens exactly like what your video shows. Part of the window is black, and the color change stops (no more white to black and black to white inside the window)
I try to upload a video that i captured when I run this code on a PC without Nvidia card. I failed to upload it here so i put it to YouTube temporarily. Here is the link:
https://youtu.be/3GV6idiBxP8
This video shows you how it looks like when no problem happens.
My software are used by different users on different machines. From all the information that i collected, all problem cases involve Nvidia card on PC desktop. On the other hand, i did not come across such problem on a PC desktop without Nvidia card. This problem does not even happen on notebook with Nvidia card. Thus I believe that it is the high-end Nvidia card that does not work well with Java2D.
If you change the code "size(800, 600);" to "size(800, 600, P2D);" or "size(800, 600, OPENGL);". The program works without problem in PC dekstop with Nvidia card, although dragging the edge of window is a bit difficult under these two cases.
Stefterv commentedon Jan 21, 2025
Thanks for confirming the issue, I've created a minimum reproducible example:
Stefterv commentedon Jan 21, 2025
I've traced the issue to these lines:
processing4/core/src/processing/awt/PSurfaceAWT.java
Lines 662 to 664 in 628b69d
Disabling these stops the crash, pausing on them with a debugger also stops it so it leads me suspect a race condition
Stefterv commentedon Jan 21, 2025
Even smaller example of the issue. This crashes reliably on my machine with 30 or so frames
Fix for processing#931
Stefterv commentedon Jan 21, 2025
Hi @MartinTheSun I've added a PR that might hopefully solve the issue.
Please download the test version of processing here https://github.com/processing/processing4/actions/runs/12882788847/job/35915711434 and let me know if that solves your issue
15 remaining items