In Opera, the window doesn't close when closing the last tab.
I've looked in the settings but can't find any way to change this. Is it even possible to do this? If so, where?
Ctrl+W closes the tabs while Ctrl+Shift+W closes the browser. So maybe instead of clicking the X button you can press Ctrl+W to close the tabs then when you get to the last on Add Shift. Its not exactly what you are trying to accomplish but at least its a relatively easy alternative.