Example 1: Suppose I open up a Finder window, then I start to browse in Chrome. After a while I forgot there is already a Finder instance, and open up a new Finder window. Upon hitting ⌘+w to close this new instance, the system automatically takes me to the very first Finder window I opened, not the Chrome window which I am currently browsing.
Example 2: While in Finder, I click a pdf 1.pdf file and open it. Then I click a second pdf file, 2.pdf. Now if I use ⌘+w to close 2.pdf. The system will again automatically brings me to the window of 1.pdf, not the Finder window which I was previously working on.
Question: Is there a way to modify the behavior of ⌘+w? so that while I close a window from an app A, I am exited to the app B before I open A, not other older instances of app A.