Skip to content
This repository was archived by the owner on Aug 31, 2021. It is now read-only.

[[ Bug 14056 ]] Setting the cursor to none should have an effect - an…#2413

Merged
livecodesebastien merged 4 commits into
livecode:develop-6.7from
livecodesebastien:bugfix-14056
Jul 8, 2015
Merged

[[ Bug 14056 ]] Setting the cursor to none should have an effect - an…#2413
livecodesebastien merged 4 commits into
livecode:develop-6.7from
livecodesebastien:bugfix-14056

Conversation

@livecodesebastien

Copy link
Copy Markdown
Contributor

…d hide the cursor

@livecodesebastien livecodesebastien added this to the 6.7.7-rc-1 milestone Jun 16, 2015
@runrevmark

Copy link
Copy Markdown
Contributor

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.

@livecodesebastien

Copy link
Copy Markdown
Contributor Author

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 hide cursor command, then that would certainly make sense, but here we do ask to set the cursor to nothing.

With the current mechanism, setting MCcursors[PI_NONE] to nil makes the LiveCode script set the cursor to none behave like unlock cursor, since no cursor is given. Should I update the way we change cursors?

@runrevmark

Copy link
Copy Markdown
Contributor

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).

@livecodesebastien

Copy link
Copy Markdown
Contributor Author

Unhiding the cursor each time SetCursor is called appears to be necessary, because as you stated, it is counted - and

lock cursor
set the cursor to none
set the cursor to none
unlock cursor

leaves the cursor hidden until the mouse moves

…s it can hide it), remoe unused MCPlatformHideCursor
@runrevmark

Copy link
Copy Markdown
Contributor

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?

@livecodesebastien

Copy link
Copy Markdown
Contributor Author

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.

@runrevmark

Copy link
Copy Markdown
Contributor

@livecode-vulcan review ok e759cec

@livecode-vulcan

Copy link
Copy Markdown
Contributor

💙 review by @runrevmark ok e759cec

livecode-vulcan added a commit that referenced this pull request Jul 8, 2015
[[ Bug 14056 ]] Setting the cursor to none should have an effect - an…

…d hide the cursor
@livecode-vulcan

Copy link
Copy Markdown
Contributor

😎 test success e759cec

livecodesebastien added a commit that referenced this pull request Jul 8, 2015
[[ Bug 14056 ]] Setting the cursor to none should have an effect - an…
@livecodesebastien livecodesebastien merged commit 339c69d into livecode:develop-6.7 Jul 8, 2015
@livecodesebastien livecodesebastien deleted the bugfix-14056 branch July 8, 2015 15:15
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants