|
42 | 42 | }; |
43 | 43 | }; |
44 | 44 |
|
45 | | -static MCPlatformCursor *s_hidden_cursor = nil; |
46 | | -static MCPlatformCursor *s_current_cursor = nil; |
| 45 | +static bool s_cursor_is_hidden = false; |
47 | 46 | static NSCursor *s_watch_cursor = nil; |
48 | 47 |
|
49 | 48 | static unsigned char s_watch_cursor_bits[] = |
@@ -182,12 +181,23 @@ void MCPlatformReleaseCursor(MCPlatformCursorRef p_cursor) |
182 | 181 | MCMemoryDelete(p_cursor); |
183 | 182 | } |
184 | 183 |
|
185 | | -void MCPlatformShowCursor(MCPlatformCursorRef p_cursor) |
| 184 | +void MCPlatformSetCursor(MCPlatformCursorRef p_cursor) |
186 | 185 | { |
187 | 186 | if (p_cursor -> is_standard) |
188 | | - { |
| 187 | + { |
| 188 | + // By default, we want the cursor to be visible. |
| 189 | + if (s_cursor_is_hidden) |
| 190 | + { |
| 191 | + [NSCursor unhide]; |
| 192 | + s_cursor_is_hidden = false; |
| 193 | + } |
189 | 194 | switch(p_cursor -> standard) |
190 | 195 | { |
| 196 | + // SN-2015-06-16: [[ Bug 14056 ]] Hidden cursor is part of the cursors |
| 197 | + case kMCPlatformStandardCursorNone: |
| 198 | + [NSCursor hide]; |
| 199 | + s_cursor_is_hidden = true; |
| 200 | + break; |
191 | 201 | case kMCPlatformStandardCursorArrow: |
192 | 202 | [[NSCursor arrowCursor] set]; |
193 | 203 | break; |
@@ -216,29 +226,6 @@ void MCPlatformShowCursor(MCPlatformCursorRef p_cursor) |
216 | 226 | [p_cursor -> custom set]; |
217 | 227 | } |
218 | 228 |
|
219 | | -void MCPlatformHideCursor(void) |
220 | | -{ |
221 | | - if (s_hidden_cursor == nil) |
222 | | - { |
223 | | - uint32_t t_img_data; |
224 | | - t_img_data = 0; |
225 | | - |
226 | | - MCImageBitmap t_image; |
227 | | - t_image . width = 1; |
228 | | - t_image . height = 1; |
229 | | - t_image . stride = 4; |
230 | | - t_image . data = &t_img_data; |
231 | | - |
232 | | - MCPoint t_hot_spot; |
233 | | - t_hot_spot . x = 0; |
234 | | - t_hot_spot . y = 0; |
235 | | - MCPlatformCreateCustomCursor(&t_image, t_hot_spot, s_hidden_cursor); |
236 | | - |
237 | | - } |
238 | | - |
239 | | - MCPlatformShowCursor(s_hidden_cursor); |
240 | | -} |
241 | | - |
242 | 229 | void MCPlatformHideCursorUntilMouseMoves(void) |
243 | 230 | { |
244 | 231 | [NSCursor setHiddenUntilMouseMoves: YES]; |
|
0 commit comments