mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-02-25 09:33:50 +00:00
Captures secondary window close events so secondary windows can be closed via hitting the x on the window itself.
This commit is contained in:
parent
b2c4ff7745
commit
7d0831143c
2 changed files with 17 additions and 5 deletions
|
|
@ -101,7 +101,8 @@ mPosition(0,0),
|
|||
mMouseLocked(false),
|
||||
mShouldLockMouse(false),
|
||||
mSuppressReset(false),
|
||||
mMenuHandle(NULL)
|
||||
mMenuHandle(NULL),
|
||||
mClosing(false)
|
||||
{
|
||||
mCursorController = new PlatformCursorControllerSDL( this );
|
||||
|
||||
|
|
@ -583,8 +584,10 @@ void PlatformWindowSDL::_processSDLEvent(SDL_Event &evt)
|
|||
|
||||
case SDL_WINDOWEVENT:
|
||||
{
|
||||
switch( evt.window.event )
|
||||
if (!mClosing)
|
||||
{
|
||||
switch (evt.window.event)
|
||||
{
|
||||
case SDL_WINDOWEVENT_FOCUS_GAINED:
|
||||
appEvent.trigger(getWindowId(), GainFocus);
|
||||
break;
|
||||
|
|
@ -595,15 +598,21 @@ void PlatformWindowSDL::_processSDLEvent(SDL_Event &evt)
|
|||
case SDL_WINDOWEVENT_RESIZED:
|
||||
{
|
||||
int width, height;
|
||||
SDL_GetWindowSize( mWindowHandle, &width, &height );
|
||||
mVideoMode.resolution.set( width, height );
|
||||
SDL_GetWindowSize(mWindowHandle, &width, &height);
|
||||
mVideoMode.resolution.set(width, height);
|
||||
getGFXTarget()->resetMode();
|
||||
resizeEvent.trigger(getWindowId(), width, height);
|
||||
break;
|
||||
}
|
||||
case SDL_WINDOWEVENT_CLOSE:
|
||||
{
|
||||
appEvent.trigger(getWindowId(), WindowClose);
|
||||
mClosing = true;
|
||||
}
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -648,4 +657,4 @@ void PlatformWindowSDL::setKeyboardTranslation(const bool enabled)
|
|||
mOwningManager->updateSDLTextInputState(PlatformWindowManagerSDL::KeyboardInputState::TEXT_INPUT);
|
||||
else
|
||||
mOwningManager->updateSDLTextInputState(PlatformWindowManagerSDL::KeyboardInputState::RAW_INPUT);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue