-
Bug
-
Resolution: Fixed
-
P4
-
1.2.0, 1.3.0
-
beta2
-
x86
-
windows_nt, windows_2000
Name: vi73552 Date: 03/07/99
If you try to use custom cursors in drag and drop, you will experience very busy flickers of the standard cursors and the custom cursors.
I found out a problem in java.awt.dnd. DragSourceContext.java.
Currently, the method void setCursor(Cursor c) reads like this:
public void setCursor(Cursor c) {
if (cursor == null || !cursor.equals(c)) {
cursorDirty = true;
cursor = c;
if (peer != null) peer.setCursor(cursor);
}
}
However, if listener.dragOver(dsde) set the same cursor repeatedly, which is likely to happen, the first time cursorDirty become true, and the second time cursorDirty does not become true, and so on.
As conclusion, you will see both of the standard cursor and the custom cursor as flickers.
If you change the method so that it always makes cursorDirty to be true as follows, you will get a big improvement.
public void setCursor(Cursor c) {
cursorDirty = true; // new of the statement
if (cursor == null || !cursor.equals(c)) {
// cursorDirty = true; // old place of the statement
cursor = c;
if (peer != null) peer.setCursor(cursor);
}
}
In the above change, however, you cannot keep the meening of cursorDirty.
cursorReady or cursorChanged would be better name.
(Review ID: 53867)
======================================================================
- duplicates
-
JDK-4407497 DragSourceContext changes cursor when it shouldn't
-
- Closed
-