Bug #8919
Cursor issues with LOAD-MOUSE-POINTER and Win32 SetCursor
20%
History
#1 Updated by Șerban Bursuc about 2 years ago
This task is meant to address some current issues regarding the cursor.
As of writing, there are several issues:
- Swing client isn't loading cursors loaded with
LOAD-MOUSE-POINTERcorrectly. - Web client doesn't load certain cursors.
- Swing client doesn't display the cursor set with
SetCursoron all windows.
#3 Updated by Șerban Bursuc almost 2 years ago
- % Done changed from 0 to 20
- Status changed from New to WIP
Made a partial commit to 8919a rev 15351.
This task is blocked by #8897, but some changes are not. I see a pattern here: a lot of cursor updates aren't done because some widgets do not have cursors update on mouse events. I'm not sure why the lack of this, is another component supposed to change the cursor on mouse events for these widgets, or is cursor decided at widget level?
These changes specifically fix the testcase uast/cursor/cursor-user32.p, but I suspect this is an issue for many other widgets. Maybe the default mouse event handler (for example mouseEnter) should update the cursor, in AbstractWidget?
Regarding this point:
- Web client doesn't load certain cursors.
This is to be expected, some cursors do not have their image uploaded, and in the code they are commented.
private static final Map<MousePointer, String> mousePointerFiles = Collections
.unmodifiableMap(new EnumMap<MousePointer, String>(MousePointer.class)
{
{
// put(MousePointer.APPSTARTING, "appstarting.cur");
// put(MousePointer.HELP, "help.cur");
put(MousePointer.NO, "no.cur");
// put(MousePointer.RECTANGLE, "rectangle.cur");
// put(MousePointer.UPARROW, "uparrow.cur");
// put(MousePointer.COMPILER_WAIT, "wait.cur");
put(MousePointer.SIZE_NS, "sizens.cur");
put(MousePointer.SIZE_WE, "sizewe.cur");
put(MousePointer.COPY, "copy.cur");
}
});
This seems trivial, but I won't start adding images of my own.
- Swing client doesn't display the cursor set with
SetCursoron all windows.
This is easily fixable by simply iterating through the window list and assigning a cursor to every window. As far as I can see, there is no such thing as a driver level cursor in Swing, every cursor is component bound. This seems like a fair idea to me. I've seen cases where an event listener can be added to explicitly prevent a cursor change, but where would such a AWTEventListener go in the first place?