If you have top panel you should know that it is not often easy to shoot correctly on close button of window.
So you can do the way I did:)
I've installed 'wmctrl' package and created panel launcher with command:
wmctrl -c :ACTIVE:
and placed it at right-top corner of screen.
It closes active window.