benfry / processing4

Processing 4.x releases for Java 17
https://processing.org
Other
1.35k stars 239 forks source link

Resize cursor not showing in P2D & P3D #657

Open Aryszin opened 1 year ago

Aryszin commented 1 year ago

Cursors in P2D Mode & P3D would be great, because if you resize the window it doesnt show it!

SableRaf commented 1 year ago

Thank you for bringing this issue to our attention! Can you please provide more information about what you are experiencing with cursors in P2D and P3D modes? It would also be helpful if you could follow the provided issue template to give us a better understanding of your setup and the steps you've taken to reproduce this issue.

Additionally, could you please specify what you mean by "if you resize the window it doesn't show it"? Are you referring to the cursor not being displayed or not being displayed correctly when the window is resized?

Any additional details or screenshots that you can provide will be greatly appreciated. Thank you!

Aryszin commented 1 year ago

So heres a detailed explanation of alle the things i want to adress:

Firstly the cursors that windows show, when resizing the window, are not shown if using other Renderes than the default one.

Secondly there is a bug, when the "cursor()" keyword is used too often in the draw loop, that it doesnt change after a while, even if "cursor()" is called with a different keyword in the brackets.

Thirdly the cursors in P2D & P3D are not the same as in the default renderer, i don't know if this is changeable because of OpenGL but the standard operating cursor would be great!

Also here are a few bugs/glitches i noticed while trying out the different available renderers (Default, P2D, P3D, FX2D), that are not related to cursors:

I hope this helped!

dman2210 commented 1 year ago

follow the provided issue template to give us a better understanding of your setup and the steps you've taken to reproduce this issue.

Description

The mouse cursor is not displayed correctly when resizing the window. The arrow cursor is shown instead of the east-west resize cursor.

Expected Behavior

The mouse cursor changes to east-west resize cursor at the edge of the window where it can be resized.

Current Behavior

The mouse cursor does not change.

Steps to Reproduce

  1. surface.setResizable(true);
  2. run the sketch. move your cursor to the edge of the window.

Your Environment

Additionally, could you please specify what you mean by "if you resize the window it doesn't show it"? Are you referring to the cursor not being displayed or not being displayed correctly when the window is resized? It is not displayed correctly. The arrow cursor is shown instead of the east-west resize cursor.

Any additional details or screenshots that you can provide will be greatly appreciated. Thank you!

I believe it is a windows only issue but I have not checked.

https://user-images.githubusercontent.com/32994314/234109470-3b98d530-e1cb-4c34-bd65-631bcf40069c.mp4

retiutut commented 5 months ago

https://jogamp.org/bugzilla/show_bug.cgi?id=1296

retiutut commented 5 months ago

A workaround can be achieved using built-in Processing.

int prevMouseX, prevMouseY;
int windowW, windowH;
boolean isMouseResizing = false;

void settings() {
    size(400, 600, P2D);
}

void setup() {
    surface.setResizable(true);    
}

void draw() {
    background(100);
    fill(255);
    text(millis(), width/2, height/2);
    rect(width - 10, 0, 10, height);
    prevMouseX = mouseX;

}

void mouseDragged() {
    if (mouseX > width - 10) {
        cursor(MOVE);
        isMouseResizing = true;
    }
    println("MOUSE DRAGGED--"+millis());
}

void mouseReleased() {
    if (isMouseResizing) {
        cursor(ARROW);
        isMouseResizing = false;
        windowResize(mouseX, height);
    }
    println("MOUSE RELEASED");
}