Skip to content
This repository was archived by the owner on Aug 31, 2021. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
[[ Bug 14056 ]] Setting the cursor to none should have an effect - an…
…d hide the cursor
  • Loading branch information
livecodesebastien committed Jun 16, 2015
commit 86ad72f166201ab3c84e57c1e4e7d02c0c6e8972
1 change: 1 addition & 0 deletions docs/notes/bugfix-14056.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Cannot hide cursor on Mac from LiveCode 6.7
8 changes: 4 additions & 4 deletions engine/src/desktop-dc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -316,9 +316,10 @@ void MCScreenDC::platform_boundrect(MCRectangle &rect, Boolean title, Window_mod

////////////////////////////////////////////////////////////////////////////////

// SN-2015-06-16: [[ Bug 14056 ]] PI_NONE should be a valid cursor type
static MCPlatformStandardCursor theme_cursorlist[PI_NCURSORS] =
{
kMCPlatformStandardCursorArrow, kMCPlatformStandardCursorArrow,
kMCPlatformStandardCursorNone, kMCPlatformStandardCursorArrow,
kMCPlatformStandardCursorArrow, kMCPlatformStandardCursorArrow, kMCPlatformStandardCursorArrow, kMCPlatformStandardCursorWatch, kMCPlatformStandardCursorWatch,
kMCPlatformStandardCursorCross, kMCPlatformStandardCursorArrow, kMCPlatformStandardCursorIBeam, kMCPlatformStandardCursorArrow, kMCPlatformStandardCursorArrow,
kMCPlatformStandardCursorArrow, kMCPlatformStandardCursorCross, kMCPlatformStandardCursorWatch, kMCPlatformStandardCursorArrow
Expand Down Expand Up @@ -356,10 +357,9 @@ void MCScreenDC::resetcursors()
freecursor(MCcursors[i]);
MCcursors[i] = nil;

// SN-2015-06-16: [[ Bug 14056 ]] PI_NONE should be a valid cursor type
MCImage *im;
if (i == PI_NONE)
MCcursors[i] = nil;
else if ((im = (MCImage *)MCdispatcher->getobjid(CT_IMAGE, i)) != NULL)
if ((im = (MCImage *)MCdispatcher->getobjid(CT_IMAGE, i)) != NULL)
MCcursors[i] = im -> createcursor();
else if (i < PI_BUSY1)
MCPlatformCreateStandardCursor(theme_cursorlist[i], MCcursors[i]);
Expand Down
8 changes: 7 additions & 1 deletion engine/src/mac-cursor.mm
Original file line number Diff line number Diff line change
Expand Up @@ -185,9 +185,15 @@ void MCPlatformReleaseCursor(MCPlatformCursorRef p_cursor)
void MCPlatformShowCursor(MCPlatformCursorRef p_cursor)
{
if (p_cursor -> is_standard)
{
{
// By default, we want the cursor to be visible.
[NSCursor unhide];
switch(p_cursor -> standard)
{
// SN-2015-06-16: [[ Bug 14056 ]] Hidden cursor is part of the cursors
case kMCPlatformStandardCursorNone:
[NSCursor hide];
break;
case kMCPlatformStandardCursorArrow:
[[NSCursor arrowCursor] set];
break;
Expand Down
4 changes: 3 additions & 1 deletion engine/src/platform.h
Original file line number Diff line number Diff line change
Expand Up @@ -636,10 +636,12 @@ void MCPlatformGetMenubar(MCPlatformMenuRef menu);

typedef class MCPlatformCursor *MCPlatformCursorRef;

// SN-2015-06-16: [[ Bug 14056 ]] Add hidden cursor as part of the standard ones
enum MCPlatformStandardCursor
{
kMCPlatformStandardCursorUnknown,


kMCPlatformStandardCursorNone,
kMCPlatformStandardCursorArrow,
kMCPlatformStandardCursorWatch,
kMCPlatformStandardCursorCross,
Expand Down