NSView on OSX10.5 does not respond to setAcceptsTouchEvents

Hi guys,

I have OSX 10.7, but my wife is still running on OSX 10.5, and I use her
machine to test whether it’s backward compatible.

I’ve noticed that SDL does this:

#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1060
[view setAcceptsTouchEvents:YES];
#endif

which is okay, but I still want to compile with
MAC_OS_X_VERSION_MAX_ALLOWED >= 1600, but at runtime to check whether
setAcceptsTouchEvents: is allowed.

I saw that in the same source code below, respondToSelector: is used - I
have some minimal Objective C knowledge, so I came up with this workaround:

src/video/cocoa/SDL_cocoawindow.m

#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1060
[view setAcceptsTouchEvents:YES];
#endif

becomes

#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1060
if( [view respondsToSelector: @selector(setAcceptsTouchEvents:)] ) {
[view setAcceptsTouchEvents:YES];
}
#endif

Would that be a fine thing to have, or would there be more?

Thanks,
Dimiter ‘malkia’ Stanev.

#if MAC_OS_X_VERSION_MAX_ALLOWED>= 1060
if( [view respondsToSelector: @selector(setAcceptsTouchEvents:)] ) {
[view setAcceptsTouchEvents:YES];
}
#endif

Would that be a fine thing to have, or would there be more?

This is a correct fix, I think. I’ve put this in revision control as hg
changeset f3c34d321289.

Thanks!

–ryan.