Fix exiting OpenMW via the window close button (regression)

pull/136/head
scrawl 11 years ago
parent 4f35fd8184
commit c3d9bc31bb

@ -641,6 +641,11 @@ namespace MWInput
mOgre.windowResized(x,y); mOgre.windowResized(x,y);
} }
void InputManager::windowClosed()
{
MWBase::Environment::setRequestExit();
}
void InputManager::toggleMainMenu() void InputManager::toggleMainMenu()
{ {
if (MyGUI::InputManager::getInstance ().isModalAny()) if (MyGUI::InputManager::getInstance ().isModalAny())

@ -97,6 +97,7 @@ namespace MWInput
virtual void windowVisibilityChange( bool visible ); virtual void windowVisibilityChange( bool visible );
virtual void windowFocusChange( bool have_focus ); virtual void windowFocusChange( bool have_focus );
virtual void windowResized (int x, int y); virtual void windowResized (int x, int y);
virtual void windowClosed ();
virtual void channelChanged(ICS::Channel* channel, float currentValue, float previousValue); virtual void channelChanged(ICS::Channel* channel, float currentValue, float previousValue);

@ -70,6 +70,8 @@ public:
/** @remarks The window got / lost input focus */ /** @remarks The window got / lost input focus */
virtual void windowFocusChange( bool have_focus ) {} virtual void windowFocusChange( bool have_focus ) {}
virtual void windowClosed () {}
virtual void windowResized (int x, int y) {} virtual void windowResized (int x, int y) {}
}; };

@ -103,7 +103,8 @@ namespace SFO
handleWindowEvent(evt); handleWindowEvent(evt);
break; break;
case SDL_QUIT: case SDL_QUIT:
Ogre::Root::getSingleton().queueEndRendering(); if (mWindowListener)
mWindowListener->windowClosed();
break; break;
default: default:
std::cerr << "Unhandled SDL event of type " << evt.type << std::endl; std::cerr << "Unhandled SDL event of type " << evt.type << std::endl;

Loading…
Cancel
Save