Certain apps occasionally won't unhide once hidden On one of my Macs certain apps, e.g. Safari, Xcode and Disk Utility, sometimes cannot be unhidden once they were hidden by me, and it's quite annoying and disruptive to my workflow. I could use some help figuring out how to fix this.

The symptoms are:


I hide the app explicitly (either by typing cmd+H or option-clicking into another app's window, not sure if only one of them is causing it). This also makes the icon become dimmed in the Dock.
Then, sometimes, when I then click into the Dock's dimmed icon, the app would not react, i.e. it would not come forward, nor would it show its window(s), and the Dock icon remains dimmed.
If there are still some windows visible, clicking into them does not have any effect, either, even though the window might appear to be frontmost (i.e. the title bar is showing the colored buttons on the left).
The window would, however, track my mouse moves inside, just not react to clicks or drag operations (I can tell this in Safari windows where the content reacts to the mouse moving).


Basically, the app (or the Cocoa framework) doesn't know any more in which state it is: Hidden or Unhidden.

I can half-fix this by performing these steps:


Activate a different app, e.g. the Finder.
Right-click into the dimmed app's Dock icon, and choose Show All Windows
Click into any of the offered windows.


With that, the windows behave normally again, e.g. I can click into them, but the Dock icon remains dimmed (even though clicking the icon will bring the app forward again), and the app's Hide command (cmd+H) does not work any more, even though it's enabled in the menu.

Has anyone else seen this behavior and/or has an idea what's causing this?

Since I've been suffering from this for many years, and over several OSX versions, here's a few things I've tried and considered:


It does only happen with a certain set of apps. So far, most if not not (not entirely sure) are made by Apple. And they're all Cocoa (not older Carbon) apps. Most apps do never show this issue.
It doesn't seem to be caused by a 3rd party system extension, as I've disabled practically all of them to rule them out. This includes: Little Snitch, DragThing, iClip, Default Folder, TotalFinder, SizeUp, Timbuktu.
I just now even did a complete re-install of macOS 10.12.6, then using the Migration Assistant to clone my previous system. This did reset some stuff (e.g. got rid of old Brew, Fink and MacPorts installation), but the problem persists.
Oddly, I've also used the Migration Assistant to install 10.12 and 10.13 on my other Macs, and none of those show this issue.
It's not that particular Mac hardware, either - I used to have a MacPro 2008 until yesterday, but now it's a MP 2010 model, yet I see the problem on both (running the same system).
I suspect it's one of the many "secret" (i.e. unsupported) preferences I've set over the years in order to keep old behavior enabled that Apple has changed in newer systems. I had a look at many prefs using Prefs Editor, but could not identify anything related to this behavior.


One thing that may be of significance (though I also use this feature on other Macs where I don't see the issue): I am using 4 desktop spaces, and often switch between them using keyboard shortcuts. I wonder if the issue is a combination of switching to another space while hiding or unhiding the app, causing the app's "hidden" state to go into a permanent limbo state.

The only obvious thing where the problematic Mac differs from all unaffected others is that it has two monitors whereas the others only have one.
I'm getting this situation as well. The ways I've found to make them show again after switching to each app is either


Selecting Window > Zoom and then resizing it after it appears, filling the screen.
Selecting View > Enter full screen (or ^-command-F) then exiting full screen.


I haven't found a way to prevent it from happening. It doesn't happen to every app or happen every time I hide apps and close my laptop.