From b115d75a66847c4a49770161b105a9a64685c043 Mon Sep 17 00:00:00 2001 From: Kazuki Sakamoto Date: Sun, 4 Dec 2016 17:09:34 -0800 Subject: [PATCH] Introduce MMUseCGLayerAlways user default Add user default key `MMUseCGLayerAlways` to control to use CGLayer rendering always in Core Text Renderer. $ defaults write org.vim.MacVim MMUseCGLayerAlways -bool YES --- src/MacVim/MMAppController.m | 1 + src/MacVim/MMCoreTextView.m | 2 ++ src/MacVim/Miscellaneous.h | 1 + src/MacVim/Miscellaneous.m | 1 + 4 files changed, 5 insertions(+) diff --git a/src/MacVim/MMAppController.m b/src/MacVim/MMAppController.m index f61f3902bb..7162187a23 100644 --- a/src/MacVim/MMAppController.m +++ b/src/MacVim/MMAppController.m @@ -233,6 +233,7 @@ + (void)initialize [NSNumber numberWithBool:NO], MMSuppressTerminationAlertKey, [NSNumber numberWithBool:YES], MMNativeFullScreenKey, [NSNumber numberWithDouble:0.25], MMFullScreenFadeTimeKey, + [NSNumber numberWithBool:NO], MMUseCGLayerAlwaysKey, nil]; [[NSUserDefaults standardUserDefaults] registerDefaults:dict]; diff --git a/src/MacVim/MMCoreTextView.m b/src/MacVim/MMCoreTextView.m index 9a5a8a6d93..07afb59b11 100644 --- a/src/MacVim/MMCoreTextView.m +++ b/src/MacVim/MMCoreTextView.m @@ -132,6 +132,8 @@ - (id)initWithFrame:(NSRect)frame if (!(self = [super initWithFrame:frame])) return nil; + cgLayerEnabled = [[NSUserDefaults standardUserDefaults] + boolForKey:MMUseCGLayerAlwaysKey]; cgLayerLock = [NSLock new]; // NOTE! It does not matter which font is set here, Vim will set its diff --git a/src/MacVim/Miscellaneous.h b/src/MacVim/Miscellaneous.h index 909484daec..68380bb99a 100644 --- a/src/MacVim/Miscellaneous.h +++ b/src/MacVim/Miscellaneous.h @@ -52,6 +52,7 @@ extern NSString *MMSuppressTerminationAlertKey; extern NSString *MMNativeFullScreenKey; extern NSString *MMUseMouseTimeKey; extern NSString *MMFullScreenFadeTimeKey; +extern NSString *MMUseCGLayerAlwaysKey; // Enum for MMUntitledWindowKey diff --git a/src/MacVim/Miscellaneous.m b/src/MacVim/Miscellaneous.m index 9a80706a54..5351e43d25 100644 --- a/src/MacVim/Miscellaneous.m +++ b/src/MacVim/Miscellaneous.m @@ -48,6 +48,7 @@ NSString *MMNativeFullScreenKey = @"MMNativeFullScreen"; NSString *MMUseMouseTimeKey = @"MMUseMouseTime"; NSString *MMFullScreenFadeTimeKey = @"MMFullScreenFadeTime"; +NSString *MMUseCGLayerAlwaysKey = @"MMUseCGLayerAlways";