Document window - conditional close (SOLVED)

How to prevent document window close when user clicks on native title bar close button?

For example, when it happens i ask user to discard changes - if he doesn’t agree, i want to keep window opened.

Maybe this is something obvious and trivial, but i really can’t find a way to do it.

Thx!!!

Nevermind - Component::userTriedToCloseWindow() is the key :slight_smile: