-
Notifications
You must be signed in to change notification settings - Fork 62
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
macOS 10.12 Sierra support #278
Conversation
This commit does not build on Osx 10.11 Here's the relevant part: clang++ -o build/input.o -c -std=c++11 -stdlib=libc++ -g -Wno-deprecated-register -I/usr/local/Cellar/msgpack/1.4.1/include -Ibuild -Isrc src/input.mm
src/input.mm:42:9: error: use of undeclared identifier 'NSEventTypeKeyUp'; did you mean 'NSEventTypeSwipe'?
if (NSEventTypeKeyUp == type && NSEventModifierFlagControl & flags && 48 == [event keyCode]) {
^~~~~~~~~~~~~~~~
NSEventTypeSwipe
/System/Library/Frameworks/AppKit.framework/Headers/NSEvent.h:49:5: note: 'NSEventTypeSwipe' declared here
NSEventTypeSwipe NS_ENUM_AVAILABLE_MAC(10_5) = 31,
^
src/input.mm:42:37: error: use of undeclared identifier 'NSEventModifierFlagControl'
if (NSEventTypeKeyUp == type && NSEventModifierFlagControl & flags && 48 == [event keyCode]) {
^
2 errors generated.
scons: *** [build/input.o] Error 1
make: *** [all] Error 2 It seems that |
Maybe this will work, @bambu ? |
That still didn't build. very similar error if not the same. How about this: diff --git a/src/input.mm b/src/input.mm
index 3b63320..7eba3b5 100644
--- a/src/input.mm
+++ b/src/input.mm
@@ -39,21 +39,15 @@
/* <C-Tab> & <C-S-Tab> do not trigger keyDown events.
Catch the key event here and pass it to keyDown. */
- if ([[NSProcessInfo processInfo] operatingSystemVersion].minorVersion <= 11) {
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
- if (NSKeyDown == type && NSControlKeyMask & flags && 48 == [event keyCode]) {
- [self keyDown:event];
- return YES;
- }
-#pragma clang diagnostic pop
- } else {
- if (NSEventTypeKeyDown == type && NSEventModifierFlagControl & flags && 48 == [event keyCode]) {
- [self keyDown:event];
- return YES;
- }
- }
-
+#ifdef __MAC_10_12
+ if (NSEventTypeKeyDown == type && NSEventModifierFlagControl & flags && 48 == [event keyCode]) {
+#else
+ if (NSKeyDown == type && NSControlKeyMask & flags && 48 == [event keyCode]) {
+#endif
+ [self keyDown:event];
+ return YES;
+ }
+
return NO;
} |
I thought I had searched everywhere for a macro like that 😀 |
No worries. I only know it because i've used it before. You want to modify your PR or should I make another? |
If this is fine for you then it's also fine for me. |
I actually can't run the latest version after this commit. The app will build fine, but will hang and never start the window. I'm on 10.11.5 |
@james2doyle, that seems odd. This code change shouldn't cause anything like that. I too am on 10.11.5. Here are a few things to try:
Finally, what version of Neovim are you running? |
The app shows up in the dock, but a window never appears and the app never Maybe I should mention I'm installing via brew. I used I upgraded neovim before trying to update the app. Also, no messages On Thu, Jul 14, 2016, 7:36 PM Bambu notifications@github.com wrote:
|
@james2doyle how about now? |
Hey man. Really sorry about this but I restarted on a whim, and now it works. I didn't turn it on and off again. Again, sorry! |
OSX does maintain backwards compatibility — correct solution would be to use Edit: The macros are detailed here:
|
@rogual is correct. I had forgotten about that flag. I originally suggested |
Frustrated about not being able to build the app on the Sierra beta I took a look at what was needed. Turns it wasn't that much.
This will build without errors and work fine on 10.12. I am unsure about what it means for backwards compatibility though.
Thanks!