From ab25877af48877b225c1c66ef4523a3c6db1b0ed Mon Sep 17 00:00:00 2001 From: byuu <2107894+byuu@users.noreply.github.com> Date: Sat, 17 Aug 2019 23:53:21 +0900 Subject: [PATCH] macOS fixes. --- hiro/cocoa/widget/line-edit.cpp | 2 +- ruby/video/video.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/hiro/cocoa/widget/line-edit.cpp b/hiro/cocoa/widget/line-edit.cpp index fb6f3c61..bcae99e1 100755 --- a/hiro/cocoa/widget/line-edit.cpp +++ b/hiro/cocoa/widget/line-edit.cpp @@ -17,11 +17,11 @@ } -(void) textDidChange:(NSNotification*)n { + lineEdit->state.text = [[self stringValue] UTF8String]; lineEdit->doChange(); } -(IBAction) activate:(id)sender { - lineEdit->state.text = [[self stringValue] UTF8String]; lineEdit->doActivate(); } diff --git a/ruby/video/video.cpp b/ruby/video/video.cpp index f419b962..c673f8a3 100644 --- a/ruby/video/video.cpp +++ b/ruby/video/video.cpp @@ -329,12 +329,12 @@ auto Video::hasMonitors() -> vector { auto dictionary = IODisplayCreateInfoDictionary(displayPort, 0); if(auto names = CFDictionaryGetValue(dictionary, CFSTR(kDisplayProductName))) { auto languageKeys = CFArrayCreateMutable(kCFAllocatorDefault, 0, &kCFTypeArrayCallBacks); - CFDictionaryApplyFunction(names, MonitorKeyArrayCallback, (void*)languageKeys); + CFDictionaryApplyFunction((CFDictionaryRef)names, MonitorKeyArrayCallback, (void*)languageKeys); auto orderLanguageKeys = CFBundleCopyPreferredLocalizationsFromArray(languageKeys); CFRelease(languageKeys); if(orderLanguageKeys && CFArrayGetCount(orderLanguageKeys)) { auto languageKey = CFArrayGetValueAtIndex(orderLanguageKeys, 0); - auto localName = CFDictionaryGetValue(names, languageKey); + auto localName = CFDictionaryGetValue((CFDictionaryRef)names, languageKey); monitor.name = {1 + monitors.size(), ": ", [(__bridge NSString*)localName UTF8String]}; CFRelease(localName); }