Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix missing selector for 10.6 or earlier #16

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
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
3 changes: 2 additions & 1 deletion src/MacVim/MMAppController.m
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down
33 changes: 21 additions & 12 deletions src/MacVim/MMVimController.m
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down
3 changes: 2 additions & 1 deletion src/MacVim/MMWindowController.m
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down