[[ Bug 14056 ]] Setting the cursor to none should have an effect - an…#2413
Conversation
…d hide the cursor
|
I see how this works, however, the intent of the MCPlatform cursor API was that you should be able to show/hide the cursor independently of the cursor shape. So if the engine sets the cursor to None, then it should HideCursor, then ShowCursor when it is set to something other than None. |
|
I am not sure that setting the cursor to None is the same as hiding the cursor whilst keeping its shape. If we had a With the current mechanism, setting |
|
Okay - given how the engine is treating a 'NULL' MCCursorRef and that the engine doesn't actually use MCPlatformHideCursor() (it seems). Let's revert to your original approach, with a couple of changes. Get rid of MCPlatformHideCursor(), and change the name of MCPlatformShowCursor() to MCPlatformSetCursor(). Don't unhide universally in SetCursor since I believe NSCursor keeps a hide count. Instead, setting to None should hide, and setting to non-none should unhide. Hopefully that will keep things happily working with Mac-specific things such as 'hide cursor until mouse moves' (used by the field). |
|
Unhiding the cursor each time SetCursor is called appears to be necessary, because as you stated, it is counted - and leaves the cursor hidden until the mouse moves |
…s it can hide it), remoe unused MCPlatformHideCursor
|
Well, we shouldn't be hiding the cursor more than once at any one time - so the second set the cursor line shouldn't have any effect (as the cursor is the same). I wonder if the problem is that 'unlock cursor' isn't forcing a cursor update? |
8d8d7dd to
e759cec
Compare
|
The issue is that the number of [NSCursor hide] calls must match the number of [NSCursor unhide] calls (https://developer.apple.com/library/mac/documentation/Cocoa/Reference/ApplicationKit/Classes/NSCursor_Class/index.html) - which is now ensured to happen. |
|
@livecode-vulcan review ok e759cec |
|
💙 review by @runrevmark ok e759cec |
[[ Bug 14056 ]] Setting the cursor to none should have an effect - an… …d hide the cursor
[[ Bug 14056 ]] Setting the cursor to none should have an effect - an…
…d hide the cursor