Skip to content

Commit 4b860a2

Browse files
committed
add workaround for setTitle() resetting cursor() (fixes processing#3472)
1 parent d7af0b9 commit 4b860a2

4 files changed

Lines changed: 14 additions & 1 deletion

File tree

core/src/processing/awt/PSurfaceAWT.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -552,6 +552,12 @@ public Object getNative() {
552552
@Override
553553
public void setTitle(String title) {
554554
frame.setTitle(title);
555+
// Workaround for apparent Java bug?
556+
// https://github.com/processing/processing/issues/3472
557+
if (cursorVisible) {
558+
hideCursor();
559+
showCursor();
560+
}
555561
}
556562

557563

core/src/processing/opengl/PSurfaceJOGL.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -975,11 +975,12 @@ private static char hackToChar(short code, char def) {
975975
return def;
976976
}
977977

978+
978979
// . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
979980

980981

981982
public void setCursor(int kind) {
982-
System.err.println("Cursor types not supported in OpenGL, provide your cursor image");
983+
PGraphics.showWarning("Cursor types not yet supported in OpenGL, provide your cursor image");
983984
}
984985

985986

core/todo.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ X prevents "fullScreen() cannot be used here" message on startup
44
X https://github.com/processing/processing/issues/3545
55
X throw an error when using methods that require sketchPath outside setup()
66
X https://github.com/processing/processing/issues/3433
7+
X cursor(CROSS) breaks when using surface.setTitle()
8+
X https://github.com/processing/processing/issues/3472
79

810
fixed earlier
911
X blend() and copy() are not pixel accurate for copy/scale
@@ -80,6 +82,8 @@ opengl
8082
_ hard crash at 1920x1080, mirrored, Casey's GT 650M 1GB
8183
_ window loses focus after maximizing
8284
_ https://github.com/processing/processing/issues/3339
85+
_ Implement standard cursor types in OpenGL
86+
_ https://github.com/processing/processing/issues/3554
8387

8488

8589
opengl questions

todo.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ _ probably have to add the script/Processing.app location to user's path
4747
gui
4848
_ fix red in sidebar, the squiggly line beneath code
4949
_ show hover text with 'debug'
50+
_ show number of updates available in the footer
51+
_ https://github.com/processing/processing/issues/3518
5052
_ don't show breakpoints when debugger is off
5153
_ https://github.com/processing/processing/issues/3093
5254
_ no setting breakpoints when debugger is off

0 commit comments

Comments
 (0)