provided a way for NDOF manager to poke SystemCocoa about out-of-loop events
This commit is contained in:
@@ -234,14 +234,18 @@ public:
|
||||
* @return Indication whether the event was handled.
|
||||
*/
|
||||
GHOST_TSuccess handleWindowEvent(GHOST_TEventType eventType, GHOST_WindowCocoa* window);
|
||||
|
||||
|
||||
/**
|
||||
* Handles the Cocoa event telling the application has become active (again)
|
||||
* @return Indication whether the event was handled.
|
||||
*/
|
||||
GHOST_TSuccess handleApplicationBecomeActiveEvent();
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* External objects should call this when they send an event outside processEvents.
|
||||
*/
|
||||
void notifyExternalEventProcessed();
|
||||
|
||||
protected:
|
||||
/**
|
||||
* Initializes the system.
|
||||
@@ -298,7 +302,7 @@ protected:
|
||||
/** Start time at initialization. */
|
||||
GHOST_TUns64 m_start_time;
|
||||
|
||||
/** Event has been processed directly by Cocoa and has sent a ghost event to be dispatched */
|
||||
/** Event has been processed directly by Cocoa (or NDOF manager) and has sent a ghost event to be dispatched */
|
||||
bool m_outsideLoopEventProcessed;
|
||||
|
||||
/** Raised window is not yet known by the window manager, so delay application become active event handling */
|
||||
|
||||
@@ -994,6 +994,8 @@ bool GHOST_SystemCocoa::processEvents(bool waitForEvent)
|
||||
if (m_needDelayedApplicationBecomeActiveEventProcessing)
|
||||
handleApplicationBecomeActiveEvent();
|
||||
|
||||
// m_outsideLoopEventProcessed |= m_ndofManager->sendMotionEvent();
|
||||
|
||||
if (m_outsideLoopEventProcessed) {
|
||||
m_outsideLoopEventProcessed = false;
|
||||
return true;
|
||||
@@ -1038,6 +1040,11 @@ GHOST_TSuccess GHOST_SystemCocoa::handleApplicationBecomeActiveEvent()
|
||||
return GHOST_kSuccess;
|
||||
}
|
||||
|
||||
void GHOST_SystemCocoa::notifyExternalEventProcessed()
|
||||
{
|
||||
m_outsideLoopEventProcessed = true;
|
||||
}
|
||||
|
||||
//Note: called from NSWindow delegate
|
||||
GHOST_TSuccess GHOST_SystemCocoa::handleWindowEvent(GHOST_TEventType eventType, GHOST_WindowCocoa* window)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user