6

I am using a custom keyboard layout, created by Ukelele. It was serving me well for years, until I started to use it on a MacBook Pro with Touch Bar. I added the "Change Input Language" button to the Touch Bar's Control Strip and whenever I press it, the language is switched. It worked fine for weeks, but suddenly it is just not switching from the Touch Bar. But it does switch from the top menu bar and keyboard.

Now some technical details. I've tried to use both a .keylayout file as well as bundle file. I've tried to install it both in /Library/... and in ~/Library/.... When the problem appears, it's not easy to recover it, even with reboots. Removing/adding my custom layout again doesn't work most of the time. The Touch Bar does switch using built-in languages.

I've contacted the developer of Ukelele, but he couldn't test it due to not having a MacBook Pro with Touch Bar and had no clue.

So I looked into logs and found a Touch Bar crash:

Jul 23 21:45:17 xxxx com.apple.DFRSystemExtra.InputMenu[763]: objc[763]: Class TIMLog is implemented in both /System/Library/CoreServices/Menu Extras/TextInput.menu/Contents/SharedFrameworks/TextInputUI.framework/Versions/A/TextInputUI (0x102c88858) and /System/Library/CoreServices/ControlStrip.app/Contents/XPCServices/com.apple.DFRSystemExtra.InputMenu.xpc/Contents/MacOS/com.apple.DFRSystemExtra.InputMenu (0x102c64958). One of the two will be used. Which one is undefined.
Jul 23 21:45:18 xxxx com.apple.xpc.launchd[1] (com.apple.DFRSystemExtra.InputMenu[763]): Service exited due to signal: Segmentation fault: 11 sent by exc handler[0]

I noticed one difference - built in languages show a 2 letter language name on the Touch Bar button, while my custom layout shows an icon. I haven't found a way in Ukelele to make my custom layout show a 2 letter language abbreviation—maybe someone can suggest a way that I can try. So my guess is that it happens due to the custom layout icon, but it was copied from a built-in layout.

6
  • Do you have a Crash Report? Check the System Reports and User Reports folders in Console.app.
    – neverpanic
    Commented Jul 31, 2017 at 6:23
  • @neverpanic: yes I do. Here is download link: dropbox.com/s/y4cchsik52i7etk/…
    – Pablo
    Commented Jul 31, 2017 at 8:18
  • You're right in assuming the crash is due to the custom icon, since the backtrace contains [InputSource customIcon]. Since this crash happens in Apple code, you should probably report it as a bug to Apple.
    – neverpanic
    Commented Jul 31, 2017 at 11:35
  • @neverpanic: the same crash happens even if I completely remove language icon in Ukelele. I am not sure where to report bug to get attention. All I found is developer radar, but this issue is not related to my development.
    – Pablo
    Commented Jul 31, 2017 at 13:58
  • bugreport.apple.com is the proper place to report this, IMO.
    – neverpanic
    Commented Aug 1, 2017 at 11:29

1 Answer 1

1

I'm using the Bépo layout and I was experiencing the same issue.

I recreated the .icns file using the iconutil command. I just provided the 16x16, 16x16@2x and 32x32 icons.

  1. Create a folder named <your_layout>.iconset
  2. Put your icons inside. They MUST be named icon_16x16.png, [email protected], icon_32x32.png, …, [email protected].
  3. Run the command iconutil -c icns <your_layout>.iconset
  4. Copy the resulting .icns file to your keyboard layout.

Since then I had no more TouchBar crash on layout switch.

2
  • Apple just confirmed this to be their software bug, but for security reasons I don't have access to the original bug report, where I can track it. Anyway, I'm going to try your recommendation.
    – Pablo
    Commented Aug 11, 2017 at 8:52
  • Didn't work for me. The new .icns file was about 500Kb, multiple times more than the kbdlayout itself. It changes input for some of the apps, but not for all.
    – Pablo
    Commented Aug 12, 2017 at 19:06

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .