OSX/Cocoa : discard Cocoa GL view flush while in live resize, and send Window size change ghost message only when user releases mouse button (not in live resize).

Potentially fixing bug [#23561]
This commit is contained in:
Damien Plisson 2010-09-26 19:53:45 +00:00
parent 57527cb0ac
commit 606b800c46
2 changed files with 16 additions and 0 deletions

@ -987,6 +987,8 @@ bool GHOST_SystemCocoa::processEvents(bool waitForEvent)
return true; return true;
} }
m_ignoreWindowSizedMessages = false;
return anyProcessed; return anyProcessed;
} }
@ -1054,8 +1056,10 @@ GHOST_TSuccess GHOST_SystemCocoa::handleWindowEvent(GHOST_TEventType eventType,
case GHOST_kEventWindowSize: case GHOST_kEventWindowSize:
if (!m_ignoreWindowSizedMessages) if (!m_ignoreWindowSizedMessages)
{ {
//Enforce only one resize message per event loop (coalescing all the live resize messages)
window->updateDrawingContext(); window->updateDrawingContext();
pushEvent( new GHOST_Event(getMilliSeconds(), GHOST_kEventWindowSize, window) ); pushEvent( new GHOST_Event(getMilliSeconds(), GHOST_kEventWindowSize, window) );
m_ignoreWindowSizedMessages = true;
} }
break; break;
default: default:

@ -280,6 +280,18 @@ extern "C" {
return YES; return YES;
} }
- (void) drawRect:(NSRect)rect
{
if ([self inLiveResize])
{
//Don't redraw while in live resize
}
else
{
[super drawRect:rect];
}
}
@end @end