I get hit by this all the time. I have multiple monitors and I can scroll in a window without the window having focus. The scrolling leads you believe it has focus so when you hit cmd-w to close the window the window with actual focus closes instead.
Is Cmd+` the hidden key press? Alternatively you can go to "Window" at the menubar if you prefer to click
In the UK, for instance, it's immediately above the option key so to hit it requires clawing together your thumb and little finger. It's surprisingly awkward to switch between that and Cmd+Tab.
GNOME does this much better - window switching is done using Super+<whatever the key above Tab is>. In the US, that remains ` but elsewhere it's so much better than on MacOS.
I’d rather focus on Apple refusal to support standard dpi displays (hat tip betterdisplay), basically broken .0 releases, gimped docker implementation, useless window management and broken multi screen windows.
This is sort of true but the full truth is less straight forward.
On unfocused apps you can still send through scrolling and (mostly) perform single clicks with command + click... you can also without focus send single clicks to certain controls the developer has ad hoc allowed 'click through' on...
For mouse oriented users I'd recommend trying a focus follows mouse experience like AutoRaise [1]. But I mean, it's not like this solution existing absolves Apple of the broader criticism here about what they prioritize and deprioritize for the default user interface experience.
Me. I have to use a Mac at work, and I use the text terminal more than anything else on the computer. It doesn't help that Mac's don't have a good UI, everything is hidden behind extra key-presses, and switching between windows is a PAIN.
On a mac every window for an app is considered the same, so there's no concept of switching between windows (except with special hidden key presses).
When a window is in the background it doesn't receive clicks, so you have to click on it twice.
The menubar of a non-active window doesn't exist, so you need an extra click, first to activate the window, then to go find its menubar and do an action.
It's just a bad UI.