Portability issue

I am facing a runtime windowing problem when I try to execute my Juce program. On Windows it works fine, and when I press the close button the closeButtonPressed() function that I have overloaded in my class that inherits from DocumentWindow. On linux, the window doesn’t close and it doesn’t go into the closeButtonPressed function; but when I press ALT+F4 the window closes, and the closeButtonPressed function is called.
Do you have any ideas what can be wrong ? (It also does the same with the maximize and minimize buttons).