From 606b800c46585335d046bf565a145244b9277e63 Mon Sep 17 00:00:00 2001 From: Damien Plisson Date: Sun, 26 Sep 2010 19:53:45 +0000 Subject: 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] --- intern/ghost/intern/GHOST_SystemCocoa.mm | 4 ++++ intern/ghost/intern/GHOST_WindowCocoa.mm | 12 ++++++++++++ 2 files changed, 16 insertions(+) (limited to 'intern') 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 -- cgit v1.2.3