Cocoa TextArea custom cursor flickers and vanishes when typing

I use the TextArea as an interactive widget for structured questionnaires programmed by XojoScript. Code which has been unchanged for a decade and widely used on both Windows and Mac broke in many ways under Cocoa, primarily because events have changed in their implementation. I was able to workaround most issues in a way that is consistent with Carbon and Win32 builds. However, there remain problems with custom cursors.

It seems from Feedback that these problems were worse in earlier builds or, perhaps, they differ greatly according to how the custom cursor is implemented. I have submitted a new case with a project that illustrates them and how they are affected by the custom cursor implementation.

The issues are that:-

1 A custom cursor flickers as the mouse moves due to an intermittent change to a mouse cursor.

2 Position-depedent custom cursors set during a MouseMove event are preempted by a text cursor and appear only intermittently.

3 All cursors disappear as text is typed and reappear only when the mouse is moved.

4 The Window.MouseCursor has no effect (not important but breaks spec).

I assume the problem is with Apple’s underlying widget in the Cocoa framework and the difficulty of making it conform with the previous implementation specifications. Hopwefully, the project attached to case 31476 will be diagnostic of where the problems are arising.

31476 - Cocoa TextArea custom cursor flickers and vanishes when typing

Custom mouse cursors are interfered with by a text cursor that appears intermittently as the mouse is moved under some conditions or preempts the custom cursor under others. In addition the cursor disappears when text has been typed.

The attached project illustrates the phenomena:-

The MouseCursor may be set to a star in the App, the Window, or the TextArea.

This may be done on MouseEnter/Exit or within MouseMove.

If done within MouseMove the cursor only intermittently changes to the custom cursor.

If done on MouseEnter the custom cursor shows but as the mouse moves a text cursor is shown intermittently.

In both cases the priority of application cursor to control cursor is honoured but window cursor has no effect.

In addition in both cases, when text is being typed the cursor disappears and does not reappear until the mouse is moved.

All this makes it difficult to use a custom cursor, for example, showing that a popup menu is available for certain text, particularly if that is dependent on the location within the text.

This may relate to 8913/25304 but 8913 was marked fixed in April and the problems remain, perhaps to a lesser extent. Hopefully, the attached project may be used to diagnose them.

Forgot to include custom cursors in addition to project – second attachment now has them.

  1. All cursors disappear as text is typed and reappear only when the mouse is moved.
    It is standard behaviour on OS X and IMHO have to be the same on all platforms !
    If, you are unlucky enough, the Text Cursor is on a line you are typing on, not disappear by itself, you have to move the mouse (or go to the trackPad) to move the cursor manually. If it disappears by itself, you do not have to do it by yourself.

This is IMHO, your mileage may vary.

Thanks Emile, you are right – will amend my feedback report, Happy New Year, b.