Window manager freezes when triggering Exposé on macOS Sierra?

On my MacBook Pro (Early 2015), I've been struggling with a problem since I upgraded to Sierra.

I don't use Exposé very often, but some times, when I trigger it accidentally with a swipe on the trackpad, it freezes the window manager.

What happens is that the windows start moving inwards (like they do for Exposé) for a beat, but then stops again almost immediately. And after that, the window manager appears to be frozen. I can't bring up any menus, get the “Force Quit” window to appear or change active windows. I can bring up the Cmd-Tab switcher and select a different window, but doing so does nothing – the app that had focus keeps focus, and the windows stay as they were. I can open Siri or Alfred via keyboard shortcuts, but neither receives keyboard focus or reacts to the mouse. I can talk to Siri, but since she can't log me out or kill a process or something like that, that's also useless.

I've only found two ways out of this problem. One is to do a hard reboot (which I'm not fond of), and the other is to SSH in from another machine and do a “sudo killall Dock”, which does alleviate the issue, but requires some logistics.

Any suggestions on how I can stop these freezes, or at least get easier out of them?


Solution 1:

It's still happening with maOS Mojave 10.14.1.

When it happens to me, the OS isn't frozen, only Expose is. Music keeps playing, I can receive notifications, etc.

In this case, try adding to Dock an icon that will restart Dock:

  1. Open Automator
  2. File -> New -> Application
  3. In the search field, pick Run Shell Script
  4. In the text area, type: killall Dock (capital D on Dock)
  5. File -> Export
  6. Save it as "RestartDock" in somewhere convenient
  7. In Finder, open the directory where you saved the app and drag it to Dock

When the bug happens, try clicking on the app from Dock.

Credits to https://www.addictivetips.com/mac-os/how-to-restart-the-os-x-dock/