Disabled the Close Window button

The operating system (or window manager, or whatever) puts a box around the window, and at the top has a title and miscellaneous other buttons and menus for controlling the window and the application.

This question is about the button which closes the window, which Windows puts in the top right corner, and usually has some kind of X symbol.

My application needs to disable this, or at the least, intercept clicks to this. I want to put some kind of “Are you sure?” message in. Another requirement is that I need to prompt the user for a reason why he’s closing the application.

I’m hoping someone here has some experience with this!

Check out iced::settings::Settings::exit_on_close_request that’s fed into Ui::run