diff options
author | Damien Plisson <damien.plisson@yahoo.fr> | 2010-09-26 23:53:45 +0400 |
---|---|---|
committer | Damien Plisson <damien.plisson@yahoo.fr> | 2010-09-26 23:53:45 +0400 |
commit | 606b800c46585335d046bf565a145244b9277e63 (patch) | |
tree | f2869841639f88985026fafd3fa4efb45b4f7892 /intern | |
parent | 57527cb0ac8b153a4aa89baf655c8d58c488d3a6 (diff) |
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]
Diffstat (limited to 'intern')
-rw-r--r-- | intern/ghost/intern/GHOST_SystemCocoa.mm | 4 | ||||
-rw-r--r-- | intern/ghost/intern/GHOST_WindowCocoa.mm | 12 |
2 files changed, 16 insertions, 0 deletions
diff --git a/intern/ghost/intern/GHOST_SystemCocoa.mm b/intern/ghost/intern/GHOST_SystemCocoa.mm index b7038a30e00..c998539fea1 100644 --- a/intern/ghost/intern/GHOST_SystemCocoa.mm +++ b/intern/ghost/intern/GHOST_SystemCocoa.mm @@ -987,6 +987,8 @@ bool GHOST_SystemCocoa::processEvents(bool waitForEvent) return true; } + m_ignoreWindowSizedMessages = false; + return anyProcessed; } @@ -1054,8 +1056,10 @@ GHOST_TSuccess GHOST_SystemCocoa::handleWindowEvent(GHOST_TEventType eventType, case GHOST_kEventWindowSize: if (!m_ignoreWindowSizedMessages) { + //Enforce only one resize message per event loop (coalescing all the live resize messages) window->updateDrawingContext(); pushEvent( new GHOST_Event(getMilliSeconds(), GHOST_kEventWindowSize, window) ); + m_ignoreWindowSizedMessages = true; } break; default: diff --git a/intern/ghost/intern/GHOST_WindowCocoa.mm b/intern/ghost/intern/GHOST_WindowCocoa.mm index 83f86840eb4..aed9bd07cdc 100644 --- a/intern/ghost/intern/GHOST_WindowCocoa.mm +++ b/intern/ghost/intern/GHOST_WindowCocoa.mm @@ -280,6 +280,18 @@ extern "C" { return YES; } +- (void) drawRect:(NSRect)rect +{ + if ([self inLiveResize]) + { + //Don't redraw while in live resize + } + else + { + [super drawRect:rect]; + } +} + @end |