Occasionally when I hit the close button ('x' on the left) instead of closing the application I am looking at, it closes another application. A very common example situation:
I am using Firefox, and then I open the Trash directory. Then I click in the close button and the trash do not go away, but Firefox does.
How can I work around this problem?