File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -75,7 +75,6 @@ namespace RealEngine {
7575 RE_PROFILE_FUNCTION ();
7676
7777 EventDispatcher dispatcher (e);
78- dispatcher.Dispatch <WindowCloseEvent>(RE_BIND_EVENT_FN (Application::OnWindowClose));
7978 dispatcher.Dispatch <WindowResizeEvent>(RE_BIND_EVENT_FN (Application::OnWindowResize));
8079
8180 for (auto it = m_LayerStack.end (); it != m_LayerStack.begin ();) {
@@ -84,10 +83,15 @@ namespace RealEngine {
8483 break ;
8584 }
8685 }
86+
87+ // This is in case one of the layers doesn't want to close
88+ dispatcher.Dispatch <WindowCloseEvent>(RE_BIND_EVENT_FN (Application::OnWindowClose));
8789 }
8890
8991 bool Application::OnWindowClose (WindowCloseEvent& e) {
9092 RE_PROFILE_FUNCTION ();
93+ if (e.Handled ) // This is a special case where a layer has already handled the close event
94+ return true ;
9195
9296 Stop ();
9397
You can’t perform that action at this time.
0 commit comments