From b35bc728d3f9fbeff3356d549d66ebab127759df Mon Sep 17 00:00:00 2001 From: kervala Date: Mon, 29 Apr 2013 14:44:39 +0200 Subject: [PATCH] Changed: Process EventCloseWindowId by client --- code/ryzom/client/src/events_listener.cpp | 7 +++++++ .../client/src/interface_v3/input_handler_manager.cpp | 4 ++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/code/ryzom/client/src/events_listener.cpp b/code/ryzom/client/src/events_listener.cpp index bd2c6d45c..1d05f8a4e 100644 --- a/code/ryzom/client/src/events_listener.cpp +++ b/code/ryzom/client/src/events_listener.cpp @@ -90,6 +90,7 @@ void CEventsListener::addToServer(CEventServer& server) server.addListener(EventKeyDownId, this); server.addListener(EventKeyUpId, this); server.addListener(EventDestroyWindowId,this); + server.addListener(EventCloseWindowId, this); server.addListener(EventSetFocusId, this); server.addListener(EventDisplayChangeId, this); }// addToServer // @@ -108,6 +109,7 @@ void CEventsListener::removeFromServer (CEventServer& server) server.removeListener(EventKeyDownId, this); server.removeListener(EventKeyUpId, this); server.removeListener(EventDestroyWindowId,this); + server.removeListener(EventCloseWindowId, this); server.removeListener(EventSetFocusId, this); }// removeFromServer // @@ -141,6 +143,11 @@ void CEventsListener::operator()(const CEvent& event) // kill process exit(EXIT_SUCCESS); } + // Window close button pressed. + if(event == EventCloseWindowId) + { + CAHManager::getInstance()->runActionHandler("enter_modal", NULL, "group=ui:interface:quit_dialog"); + } // Event from the Mouse (ANGLE) if(event == EventGDMouseMove) { diff --git a/code/ryzom/client/src/interface_v3/input_handler_manager.cpp b/code/ryzom/client/src/interface_v3/input_handler_manager.cpp index bccbb8535..62eac876c 100644 --- a/code/ryzom/client/src/interface_v3/input_handler_manager.cpp +++ b/code/ryzom/client/src/interface_v3/input_handler_manager.cpp @@ -94,6 +94,7 @@ void CInputHandlerManager::addToServer(NLMISC::CEventServer * server) // System server->addListener(EventGDMouseMove, this); server->addListener(EventDestroyWindowId, this); + server->addListener(EventCloseWindowId, this); server->addListener(EventSetFocusId, this); server->addListener(EventDisplayChangeId, this); @@ -118,6 +119,7 @@ void CInputHandlerManager::release() // System _EventServer->removeListener(EventGDMouseMove, this); _EventServer->removeListener(EventDestroyWindowId, this); + _EventServer->removeListener(EventCloseWindowId, this); _EventServer->removeListener(EventSetFocusId, this); _EventServer->removeListener(EventDisplayChangeId, this); @@ -133,10 +135,8 @@ void CInputHandlerManager::release() _EventServer->removeListener(EventCharId, this); _EventServer->removeListener(EventKeyDownId, this); _EventServer->removeListener(EventKeyUpId, this); - } - // *************************************************************************** void CInputHandlerManager::operator ()(const NLMISC::CEvent &event) {