diff --git a/src/Main.gd b/src/Main.gd index 8e474e3..eed1b4f 100644 --- a/src/Main.gd +++ b/src/Main.gd @@ -121,8 +121,13 @@ func handle_backup() -> void: func _notification(what : int) -> void: - if what == MainLoop.NOTIFICATION_WM_QUIT_REQUEST: # Handle exit - show_quit_dialog() + match what: + MainLoop.NOTIFICATION_WM_QUIT_REQUEST: # Handle exit + show_quit_dialog() + MainLoop.NOTIFICATION_WM_FOCUS_OUT: # Called when the mouse isn't in the window anymore + Engine.set_target_fps(1) # then set the fps to 1 to relieve the cpu + MainLoop.NOTIFICATION_WM_MOUSE_ENTER: # Opposite of the above + Engine.set_target_fps(0) # 0 stands for maximum fps func _on_files_dropped(_files : PoolStringArray, _screen : int) -> void: