diff --git a/src/SFML/Window/OSX/SFWindowController.h b/src/SFML/Window/OSX/SFWindowController.h index c229a2cde..7dfb64589 100644 --- a/src/SFML/Window/OSX/SFWindowController.h +++ b/src/SFML/Window/OSX/SFWindowController.h @@ -51,9 +51,9 @@ namespace sf { /// as handle to WindowImpl. //////////////////////////////////////////////////////////// -#ifdef USE_OS_X_VERSION_10_4 +#if MAC_OS_X_VERSION_MAX_ALLOWED < 1060 // NSWindowDelegate is only define since 10.6 @interface SFWindowController : NSResponder { -#else /* USE_OS_X_VERSION_10_6 */ +#else @interface SFWindowController : NSResponder { #endif NSWindow* myWindow; diff --git a/src/SFML/Window/OSX/SFWindowController.mm b/src/SFML/Window/OSX/SFWindowController.mm index 1565f97d9..c839c72c6 100644 --- a/src/SFML/Window/OSX/SFWindowController.mm +++ b/src/SFML/Window/OSX/SFWindowController.mm @@ -109,7 +109,7 @@ backing:NSBackingStoreBuffered defer:NO]; /* - "YES" make some "invalid drawable". + "YES" produces some "invalid drawable". See http://www.cocoabuilder.com/archive/cocoa/152482-nsviews-and-nsopenglcontext-invalid-drawable-error.html [...] @@ -226,6 +226,11 @@ //////////////////////////////////////////////////////// -(void)setCursorPositionToX:(unsigned int)x Y:(unsigned int)y { + // Create a SFML event. + if (myRequester == 0) return; + + myRequester->MouseMovedAt(x, y); + // Flip for SFML window coordinate system y = NSHeight([myWindow frame]) - y; @@ -243,6 +248,12 @@ // Place the cursor. CGDisplayMoveCursorToPoint(screenNumber, CGPointMake(screenCoord.x, screenCoord.y)); + /* + CGDisplayMoveCursorToPoint -- Discussion : + + No events are generated as a result of this move. + Points that lie outside the desktop are clipped to the desktop. + */ }