Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Fix missing selector for 10.6 or earlier #16

Closed
wants to merge 1 commit into from

2 participants

@splhack

Hi,

I created a patch for missing selector of 10.6 or earlier. lion branch with Deployment Target=10.6 works fine on 10.6.

@b4winckler
Owner

Thanks for the patch. However, I believe the correct fix is to only use these APIs if building for 10.7 or higher, so I pushed another fix instead.

@b4winckler b4winckler closed this
@splhack

I think the lion branch can be build for 10.7, 10.6 or earlier if you use MACOSX_DEPLOYMENT_TARGET with 10.7 SDK. However your fix means that Lion fullscreen feature is only activated with MACOSX_DEPLOYMENT_TARGET=10.7. It doesn't work on 10.6. My fix is, for example, MACOSX_DEPLOYMENT_TARGET=10.6 and if that binary works on 10.7, Lion fullscreen feature is activated, and on 10.6, the former fullscreen feature is activated as well. How about it?

@b4winckler
Owner

The patch I pushed does what I initially intended it to, but I admit that I did not consider your point. I will most likely be rewriting the full screen code so that one can toggle between Lion's and MacVim's full screen code at runtime. At this point I will make it work the way you suggest. For now I'll let it be though.

Thanks for pointing this out to me.

@splhack

Thank you so much I really appreciate your work!

@jtaby jtaby referenced this pull request from a commit in jtaby/macvim
@alloy alloy Never release the leafNode. Closes #16. d0babab
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jul 21, 2011
  1. @splhack
This page is out of date. Refresh to see the latest.
View
3  src/MacVim/MMAppController.m
@@ -243,7 +243,8 @@ - (id)init
#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7)
// Disable automatic relaunching
- [NSApp disableRelaunchOnLogin];
+ if ([NSApp respondsToSelector:@selector(disableRelaunchOnLogin)])
+ [NSApp disableRelaunchOnLogin];
#endif
vimControllers = [NSMutableArray new];
View
33 src/MacVim/MMVimController.m
@@ -766,21 +766,30 @@ - (void)handleMessage:(int)msgid data:(NSData *)data
[self setServerName:name];
[name release];
} else if (EnterFullscreenMsgID == msgid) {
-#if (MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_7)
- const void *bytes = [data bytes];
- int fuoptions = *((int*)bytes); bytes += sizeof(int);
- int bg = *((int*)bytes);
- NSColor *back = [NSColor colorWithArgbInt:bg];
+#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7)
+ if ([[windowController window]
+ respondsToSelector:@selector(toggleFullScreen:)]) {
+ [[windowController window] toggleFullScreen:self];
+ } else {
+#endif
+ const void *bytes = [data bytes];
+ int fuoptions = *((int*)bytes); bytes += sizeof(int);
+ int bg = *((int*)bytes);
+ NSColor *back = [NSColor colorWithArgbInt:bg];
- [windowController enterFullscreen:fuoptions backgroundColor:back];
-#else
- [[windowController window] toggleFullScreen:self];
+ [windowController enterFullscreen:fuoptions backgroundColor:back];
+#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7)
+ }
#endif
} else if (LeaveFullscreenMsgID == msgid) {
-#if (MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_7)
- [windowController leaveFullscreen];
-#else
- [[windowController window] toggleFullScreen:self];
+#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7)
+ if ([windowController respondsToSelector:@selector(leaveFullscreen)]) {
+ [windowController leaveFullscreen];
+ } else {
+#endif
+ [[windowController window] toggleFullScreen:self];
+#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7)
+ }
#endif
} else if (SetBuffersModifiedMsgID == msgid) {
const void *bytes = [data bytes];
View
3  src/MacVim/MMWindowController.m
@@ -182,7 +182,8 @@ - (id)initWithVimController:(MMVimController *)controller
[win _setContentHasShadow:NO];
#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7)
- [win setCollectionBehavior:NSWindowCollectionBehaviorFullScreenPrimary];
+ if ([win respondsToSelector:@selector(setCollectionBehavior:)])
+ [win setCollectionBehavior:NSWindowCollectionBehaviorFullScreenPrimary];
#endif
return self;
Something went wrong with that request. Please try again.