Application Switcher -- MacBook Pro 2016 Touch Bar

Hey everyone -

I’m having a strange issue on my new MacBook and I wanted to see if any of you have experienced it anywhere else. When I’m using the application switcher and/or window switcher, they won’t stay on the screen. I hit CMD+TAB and the switcher comes up and then immediately disappears. I can’t seem to figure out what’s causing it. This happens on both the App Switcher and Window switcher.

As soon as I press the button combination the menu comes up and then immediately disappears. If I reboot I can seem to get it to work for a few moments and then it goes back to erratic behavior.

Anyone been able to identify and/or resolve this?

It’s happening to me as well (I only use the Window Switcher), but I haven’t been able to track down any specifics other than noticing that the Touch Bar content flashes quickly, probably because the focus changes as the Window Switcher appears.

Yes, I have a number of reports of this. One culprit appeared to be the Logitech Control Center software (even if disabled, just being installed was enough). Others insist they do not have it installed, so there is presumably other cases.

Symptom seems to be that it works first time, but not afterwards, which is peculiar.

The Touch Bar content should not flash I wouldn’t have thought since Keyboard Maestro Engine itself does not come to the front, but perhaps that is an indication of the problem.

There is some debugging that can be turned on the in Keyboard Maestro Engine… In the Terminal, run the command:

defaults write com.stairways.keyboardmaestro.engine Debug HotKey

Then relaunch the Keyboard Maestro Engine, then try the Command-Tab a couple times and send me what shows up in the Engine.log file.

Maybe that will give us a clue.

defaults delete com.stairways.keyboardmaestro.engine Debug

will turn debugging back off.

So I got back a log file, and it really does not tell me much.

It looks like the system is simply telling Keyboard Maestro that the Command-Tab key goes down, then up, then down, then up, then down, then up, etc.

And Keyboard Maestro is treating this as repeated triggering of the macro.

My guess is an issue in Apple’s event handling, maybe related to the Touch Bar support when changing focus windows.

I’m not sure I’m going to be able to do much about it without having my hands on one of these laptops (which I’m afraid I have no intention of purchasing).

All I can suggest is for the moment you either change the trigger key to something other the Command-Tab, or alternatively disable the Keyboard Maestro application switcher - both can be done in the Activate Application Switcher macro in the Switcher Group.

I ended up disabling both of these Macros and it went back to the default Mac Switch. I’m not sure I noticed this Group before but they are located in the Switcher Group.

Unfortunately I find that once the Window Switcher has failed this way, then the Clipboard History Switcher (which I activate with ⌘^V) also becomes much less useful in that trying to navigate the History with up and down-arrow keys no longer works – instead, they just move the insertion cursor up and down in the document where I’m trying to Paste.

2016-12-02 14:44:57 Debugging level set to ' HotKey '
2016-12-02 14:44:57 Engine Starting 7.3.1

I “load up” the history by Copying several items

2016-12-02 14:45:19 Hot Key Pressed
2016-12-02 14:45:19 DoHotKeyPressedReleasedForTriggers pressed 1 The Hot Key ⌃⌘V is pressed (fire type 0)
2016-12-02 14:45:19 Execute macro ‘Activate Clipboard History Switcher’ from trigger The Hot Key ⌃⌘V is pressed
2016-12-02 14:45:19 Hot Key Released
2016-12-02 14:45:19 DoHotKeyPressedReleasedForTriggers pressed 0 The Hot Key ⌃⌘V is pressed (fire type 0)

It works fine the first couple times

2016-12-02 14:45:35 Hot Key Pressed
2016-12-02 14:45:35 DoHotKeyPressedReleasedForTriggers pressed 1 The Hot Key ⌃⌘V is pressed (fire type 0)
2016-12-02 14:45:35 Execute macro ‘Activate Clipboard History Switcher’ from trigger The Hot Key ⌃⌘V is pressed
2016-12-02 14:45:36 Hot Key Released
2016-12-02 14:45:36 DoHotKeyPressedReleasedForTriggers pressed 0 The Hot Key ⌃⌘V is pressed (fire type 0)
2016-12-02 14:45:39 Hot Key Pressed
2016-12-02 14:45:39 DoHotKeyPressedReleasedForTriggers pressed 1 The Hot Key ⌃⌘V is pressed (fire type 0)
2016-12-02 14:45:39 Execute macro ‘Activate Clipboard History Switcher’ from trigger The Hot Key ⌃⌘V is pressed
2016-12-02 14:45:40 Hot Key Released
2016-12-02 14:45:40 DoHotKeyPressedReleasedForTriggers pressed 0 The Hot Key ⌃⌘V is pressed (fire type 0)

I fire up the Window Switcher and it works the first time

2016-12-02 14:45:52 Hot Key Pressed
2016-12-02 14:45:52 DoHotKeyPressedReleasedForTriggers pressed 1 While the Hot Key ⌃Tab is down (fire type 1)
2016-12-02 14:45:52 Execute macro ‘Activate Window Switcher’ from trigger While the Hot Key ⌃Tab is down
2016-12-02 14:45:52 Hot Key Released
2016-12-02 14:45:52 DoHotKeyPressedReleasedForTriggers pressed 0 While the Hot Key ⌃Tab is down (fire type 1)

Window Switcher fails (flashes wildly) the next time

2016-12-02 14:45:53 Hot Key Pressed
2016-12-02 14:45:53 DoHotKeyPressedReleasedForTriggers pressed 1 While the Hot Key ⌃Tab is down (fire type 1)
2016-12-02 14:45:53 Execute macro ‘Activate Window Switcher’ from trigger While the Hot Key ⌃Tab is down
2016-12-02 14:45:54 Hot Key Released
2016-12-02 14:45:54 DoHotKeyPressedReleasedForTriggers pressed 0 While the Hot Key ⌃Tab is down (fire type 1)
2016-12-02 14:45:54 Hot Key Pressed
2016-12-02 14:45:54 DoHotKeyPressedReleasedForTriggers pressed 1 While the Hot Key ⌃Tab is down (fire type 1)
2016-12-02 14:45:54 Execute macro ‘Activate Window Switcher’ from trigger While the Hot Key ⌃Tab is down
2016-12-02 14:45:54 Hot Key Released
2016-12-02 14:45:54 DoHotKeyPressedReleasedForTriggers pressed 0 While the Hot Key ⌃Tab is down (fire type 1)
2016-12-02 14:45:55 Hot Key Pressed
2016-12-02 14:45:55 DoHotKeyPressedReleasedForTriggers pressed 1 While the Hot Key ⌃Tab is down (fire type 1)
2016-12-02 14:45:55 Execute macro ‘Activate Window Switcher’ from trigger While the Hot Key ⌃Tab is down
2016-12-02 14:45:55 Hot Key Released
2016-12-02 14:45:55 DoHotKeyPressedReleasedForTriggers pressed 0 While the Hot Key ⌃Tab is down (fire type 1)
2016-12-02 14:45:55 Hot Key Pressed
2016-12-02 14:45:55 DoHotKeyPressedReleasedForTriggers pressed 1 While the Hot Key ⌃Tab is down (fire type 1)
2016-12-02 14:45:55 Execute macro ‘Activate Window Switcher’ from trigger While the Hot Key ⌃Tab is down
2016-12-02 14:45:56 Hot Key Released
2016-12-02 14:45:56 DoHotKeyPressedReleasedForTriggers pressed 0 While the Hot Key ⌃Tab is down (fire type 1)

Try the Clipboard History Switcher again

2016-12-02 14:46:00 Hot Key Pressed
2016-12-02 14:46:00 DoHotKeyPressedReleasedForTriggers pressed 1 The Hot Key ⌃⌘V is pressed (fire type 0)
2016-12-02 14:46:00 Execute macro ‘Activate Clipboard History Switcher’ from trigger The Hot Key ⌃⌘V is pressed
2016-12-02 14:46:00 Hot Key Released
2016-12-02 14:46:00 DoHotKeyPressedReleasedForTriggers pressed 0 The Hot Key ⌃⌘V is pressed (fire type 0)

At this point I used the down and up-arrow keys to try to navigate the Clipboard History, which was still visible. But instead of changing the selection in the History, it just moved the insertion cursor in the document.

2016-12-02 14:46:11 Hot Key Pressed
2016-12-02 14:46:11 DoHotKeyPressedReleasedForTriggers pressed 1 The Hot Key ⌃⌘V is pressed (fire type 0)
2016-12-02 14:46:11 Execute macro ‘Activate Clipboard History Switcher’ from trigger The Hot Key ⌃⌘V is pressed
2016-12-02 14:46:12 Hot Key Released
2016-12-02 14:46:12 DoHotKeyPressedReleasedForTriggers pressed 0 The Hot Key ⌃⌘V is pressed (fire type 0)
2016-12-02 14:46:55 Engine Quitting

To help debugging this, build and install the TouchBar server application. If I have TouchBar server running on my iMac with Sierra System Version: macOS 10.12.1 (16B2657) (you need this version for TouchBar Server to work), then I seen the application switcher act as if the hotkey is repeating. When I quit TouchBar Server, it works as expected.

TouchBar Server: https://github.com/bikkelbroeders/TouchBarDemoApp

Good luck!

Unfortunately, I don’t think I can do this until I get the next version of the OS, because my version of 10.12.1 does not support Touch Bar (some versions do, some don’t). I could probably install some sort of combo updater or something manually, but I’m presuming Apple will release 10.12.2 soon.

But that is very good to hear, it may also indicate that it is a bug with the TouchBar code which might itself be fixed in 10.12.2. One can hope anyway.

I certainly understand if you don’t want to install the MacOS version that supports touchbar server. I decided to do so. It is available, from Apple, at this link:

https://support.apple.com/kb/dl1897?locale=en_US

1 Like

Also, if you don’t want to hassle with building TouchBar Server from source, there is a similar app available from Red Sweater:

https://red-sweater.com/touche/help.html

I have not run this one, so can’t verify it has the same bug, but since the bug appears to be in the OS, I expect it does.

1 Like

Just as a further point of reference… my MacBook was a brand new out of box device, without restoration of backup. So I can 100% confirm that the Logitech software does not exist within my system. Just to add an additional data point for you.

OK, so I installed a later version of 10.12.1(16B2657), slightly later than the one referenced in TouchBar Server.

If I run TouchBar Server, then I get the problem, and if I quit it then the problem goes away.

But without TouchBar Server running, I can use Touché and the TouchBar works on screen without affecting Keyboard Maestro.

So what does that mean? What does TouchBar Server (and presumably MacBook Pros) do that Touché does not?

With TouchBar server running, it looks like the system is erroneously removing “key” on the window (ie, the ability to type in to the window, aka “focus”). I can stop the window closing when that happens, but it really does not help as then you cannot arrow around.

Looks to be some sort of bug in macOS.

I have reported it to Apple - I’m not sure I can find a workaround at this point.

1 Like

I found the root cause of the issue, caused by a bug in TouchBar Macs (or Macs running TouchBar Server) not releasing the window if it is closed it the background until some new window is created.

http://www.openradar.me/radar?id=5037983098994688

So you can actually fix the problem in Keyboard Maestro by adding this action before the Activate Switcher action

Prompt for User Input.kmactions (0.8 KB)

The action is configured to time out immediately, so it flashes on the screen and then goes away, and in doing so causes the release that should have happened much earlier to happen, which stops the bug from affecting Keyboard Maestro further.

Unfortunately, it really needs to flash up the dialog after the switch, not before it. There are other cases where it does not behave well - for example, if you open the clipboard history switcher after the application switcher, then the clipboard history switcher wont accept keys until you click on it.

I have reported the bug to Apple, and have some sort of work around that I can try. It'd be nice to know if Apple will fix the bug promptly, but it is rarely a good idea to wait on Apple fixing bugs unfortunately.

Regarding the fact that this “flashes” a window: Will a Custom HTML Prompt do the same thing?

If so, we could probably devise a simple prompt that either positions itself off the screen (if allowed), or else at least be as small as possible and at the corner of the screen.

OTOH, perhaps having it “flash” is a good idea, because it would be a reminder to remove the action once (or if) it the bug gets fixed.

Just some thoughts.

This workaround does not work for me. The switcher dialogue comes up, but I am unable to cycle through the app icons.

Anything window that has key should work.

Try extending the timeout a little, it may need a little more time to allow the previous switcher to be released before the new window is created.

I don’t suppose the 10.12.2 macOS update fixes this issue?

Hey Peter,

I just re-enabled it after updating to 12.2.2 yesterday… It appears to be working at the moment! I’ll keep an eye on using it throughout the day and report back if it acts out of line again.

1 Like

the 10.12.2 macOS update fixed it for me.

1 Like