diff -up fltk-1.3.4-2/src/Fl_cocoa.mm.macos_im fltk-1.3.4-2/src/Fl_cocoa.mm --- fltk-1.3.4-2/src/Fl_cocoa.mm.macos_im 2019-04-04 11:03:44.776519297 +0200 +++ fltk-1.3.4-2/src/Fl_cocoa.mm 2019-04-04 11:32:34.463707790 +0200 @@ -135,8 +135,11 @@ typedef OSStatus (*TSMSetDocumentPropert static TSMSetDocumentProperty_type TSMSetDocumentProperty; typedef OSStatus (*TSMRemoveDocumentProperty_type)(TSMDocumentID, OSType); static TSMRemoveDocumentProperty_type TSMRemoveDocumentProperty; -typedef CFArrayRef (*TISCreateASCIICapableInputSourceList_type)(void); -static TISCreateASCIICapableInputSourceList_type TISCreateASCIICapableInputSourceList; +typedef CFArrayRef (*TISCreateInputSourceList_type)(CFDictionaryRef, Boolean); +static TISCreateInputSourceList_type TISCreateInputSourceList; + +static CFStringRef kTISTypeKeyboardLayout; +static CFStringRef kTISPropertyInputSourceType; typedef void (*KeyScript_type)(short); static KeyScript_type KeyScript; @@ -1568,9 +1571,18 @@ static FLWindowDelegate *flwindowdelegat if (im_enabled) TSMRemoveDocumentProperty(doc, kTSMDocumentEnabledInputSourcesPropertyTag); else { + CFDictionaryRef filter; CFArrayRef inputSources; - - inputSources = TISCreateASCIICapableInputSourceList(); + + // Browsers like to use TISCreateASCIICapableInputSourceList(), + // which mostly hits the mark. But it excludes things like Greek + // and Cyrillic keyboards. So let's be more explicit. + filter = CFDictionaryCreate(NULL, + (const void **)kTISPropertyInputSourceType, + (const void **)kTISTypeKeyboardLayout, + 1, NULL, NULL); + inputSources = TISCreateInputSourceList(filter, false); + CFRelease(filter); TSMSetDocumentProperty(doc, kTSMDocumentEnabledInputSourcesPropertyTag, sizeof(CFArrayRef), &inputSources); CFRelease(inputSources); @@ -1829,8 +1841,10 @@ static int input_method_startup() TSMGetActiveDocument = (TSMGetActiveDocument_type)Fl_X::get_carbon_function("TSMGetActiveDocument"); TSMSetDocumentProperty = (TSMSetDocumentProperty_type)Fl_X::get_carbon_function("TSMSetDocumentProperty"); TSMRemoveDocumentProperty = (TSMRemoveDocumentProperty_type)Fl_X::get_carbon_function("TSMRemoveDocumentProperty"); - TISCreateASCIICapableInputSourceList = (TISCreateASCIICapableInputSourceList_type)Fl_X::get_carbon_function("TISCreateASCIICapableInputSourceList"); - retval = (TSMGetActiveDocument && TSMSetDocumentProperty && TSMRemoveDocumentProperty && TISCreateASCIICapableInputSourceList ? 1 : 0); + TISCreateInputSourceList = (TISCreateInputSourceList_type)Fl_X::get_carbon_function("TISCreateInputSourceList"); + kTISTypeKeyboardLayout = (CFStringRef)Fl_X::get_carbon_function("kTISTypeKeyboardLayout"); + kTISPropertyInputSourceType = (CFStringRef)Fl_X::get_carbon_function("kTISPropertyInputSourceType"); + retval = (TSMGetActiveDocument && TSMSetDocumentProperty && TSMRemoveDocumentProperty && TISCreateInputSourceList && kTISTypeKeyboardLayout && kTISPropertyInputSourceType ? 1 : 0); } else { KeyScript = (KeyScript_type)Fl_X::get_carbon_function("KeyScript"); retval = (KeyScript? 1 : 0);