Fixed #1151 OVQT !_Pumping assert when entering settings dialog

This commit is contained in:
rti 2010-12-12 19:08:44 +01:00
parent 86218b360f
commit 7f9f4954bc
3 changed files with 11 additions and 7 deletions

View file

@ -1023,7 +1023,7 @@ bool CDriverGL::setDisplay(nlWindow wnd, const GfxMode &mode, bool show, bool re
[_ctx flushBuffer]; [_ctx flushBuffer];
[_glView display]; [_glView display];
_EventEmitter.init(this, _glView); _EventEmitter.init(this, _glView, _DestroyWindow);
#elif defined(NL_OS_UNIX) #elif defined(NL_OS_UNIX)

View file

@ -222,10 +222,12 @@ static bool isTextKeyEvent(NSEvent* event)
return false; return false;
} }
void CCocoaEventEmitter::init(NL3D::IDriver* driver, CocoaOpenGLView* glView) void CCocoaEventEmitter::init(
NL3D::IDriver* driver, CocoaOpenGLView* glView, bool eventLoop)
{ {
_driver = driver; _driver = driver;
_glView = glView; _glView = glView;
_eventLoop = eventLoop;
} }
bool CCocoaEventEmitter::processMessage(NSEvent* event, CEventServer* server) bool CCocoaEventEmitter::processMessage(NSEvent* event, CEventServer* server)
@ -443,7 +445,8 @@ typedef bool (*cocoaProc)(NL3D::IDriver*, const void* e);
void CCocoaEventEmitter::submitEvents(CEventServer& server, bool /* allWins */) void CCocoaEventEmitter::submitEvents(CEventServer& server, bool /* allWins */)
{ {
// break if there was no event to handle // break if there was no event to handle
while(true) // if running embedded in e.g. qt, _eventLoop will be false
while(_eventLoop)
{ {
// get the next event to handle // get the next event to handle
NSEvent* event = [NSApp nextEventMatchingMask:NSAnyEventMask NSEvent* event = [NSApp nextEventMatchingMask:NSAnyEventMask

View file

@ -34,6 +34,7 @@ class CCocoaEventEmitter : public IEventEmitter
{ {
bool _emulateRawMode; bool _emulateRawMode;
bool _setToEmulateRawMode; bool _setToEmulateRawMode;
bool _eventLoop;
NL3D::IDriver* _driver; NL3D::IDriver* _driver;
CocoaOpenGLView* _glView; CocoaOpenGLView* _glView;
@ -48,7 +49,7 @@ public:
_glView(nil), _glView(nil),
_server(NULL) { } _server(NULL) { }
void init(NL3D::IDriver* driver, CocoaOpenGLView* glView); void init(NL3D::IDriver*, CocoaOpenGLView*, bool eventLoop);
bool processMessage(NSEvent* event, CEventServer* server = NULL); bool processMessage(NSEvent* event, CEventServer* server = NULL);
virtual void submitEvents(CEventServer& server, bool allWindows); virtual void submitEvents(CEventServer& server, bool allWindows);
virtual void emulateMouseRawMode(bool enable); virtual void emulateMouseRawMode(bool enable);