How to detect if the X button (Quit) is pressed?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Gamemap

How can I save the user’s data when he wants to close the window with the X button or in the Taskbar?
Is there something like quit_request ?

:bust_in_silhouette: Reply From: Mxt08

I recommend you go to project tab bar > project settings > config > Auto accept quit, and set it to false, and then go to window > and enable borderless. Now you can make your own window frame and connect signals.

Thank you, I will do this too.

Gamemap | 2021-04-03 14:40

:bust_in_silhouette: Reply From: exuin

Yeah, there’s a notification for this! And an entire doc page for this! You don’t have to make the game borderless and make your own window frame like the other answer says.