From fd334769b2f70a0aa9d18b7817b535eebf477f3c Mon Sep 17 00:00:00 2001 From: Ari Vuollet Date: Sat, 4 Apr 2026 18:52:49 +0300 Subject: [PATCH] Handle external application close events --- Source/Engine/Platform/SDL/SDLPlatform.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Source/Engine/Platform/SDL/SDLPlatform.cpp b/Source/Engine/Platform/SDL/SDLPlatform.cpp index 9d21be1fa..30851193a 100644 --- a/Source/Engine/Platform/SDL/SDLPlatform.cpp +++ b/Source/Engine/Platform/SDL/SDLPlatform.cpp @@ -12,6 +12,7 @@ #include "Engine/Platform/WindowsManager.h" #include "Engine/Platform/SDL/SDLInput.h" #include "Engine/Engine/CommandLine.h" +#include "Engine/Engine/Engine.h" #include #include @@ -199,6 +200,15 @@ void SDLPlatform::Tick() bool SDLPlatform::HandleEvent(SDL_Event& event) { + switch (event.type) + { + case SDL_EVENT_QUIT: + { + // Close request came from taskbar or macOS application menu + Engine::MainWindow->Close(ClosingReason::User); + break; + } + } return true; }