diff options
author | Michael Fisher <mfisher31@gmail.com> | 2019-09-01 03:02:08 -0400 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2019-09-03 07:27:46 +0200 |
commit | 0706f4a121f6f9c5b96a19c4272a8636fc230cbc (patch) | |
tree | e1f58000e6003ccd3ddfb57d93016612756a3cec | |
parent | 10bb9a2862b4d306eee6dc392d91eb727ea4faa9 (diff) |
Mac: Dispatch expose events from drawing view
-rw-r--r-- | pugl/detail/mac.h | 1 | ||||
-rw-r--r-- | pugl/detail/mac.m | 4 | ||||
-rw-r--r-- | pugl/detail/mac_cairo.m | 6 | ||||
-rw-r--r-- | pugl/detail/mac_gl.m | 6 |
4 files changed, 15 insertions, 2 deletions
diff --git a/pugl/detail/mac.h b/pugl/detail/mac.h index 9a5997d..8146373 100644 --- a/pugl/detail/mac.h +++ b/pugl/detail/mac.h @@ -36,6 +36,7 @@ } - (void) dispatchConfigure:(NSRect)bounds; +- (void) dispatchExpose:(NSRect)rect; @end diff --git a/pugl/detail/mac.m b/pugl/detail/mac.m index 6900ed6..36aff9b 100644 --- a/pugl/detail/mac.m +++ b/pugl/detail/mac.m @@ -77,7 +77,7 @@ puglview->backend->resize(puglview, bounds.size.width, bounds.size.height); } -- (void) drawRect:(NSRect)rect +- (void) dispatchExpose:(NSRect)rect { const PuglEventExpose ev = { PUGL_EXPOSE, @@ -850,7 +850,7 @@ puglGetTime(PuglView* view) void puglPostRedisplay(PuglView* view) { - [view->impl->wrapperView setNeedsDisplay: YES]; + [view->impl->drawView setNeedsDisplay: YES]; } PuglNativeWindow diff --git a/pugl/detail/mac_cairo.m b/pugl/detail/mac_cairo.m index b0a8db5..1f4452f 100644 --- a/pugl/detail/mac_cairo.m +++ b/pugl/detail/mac_cairo.m @@ -53,6 +53,12 @@ [wrapper dispatchConfigure:[self bounds]]; } +- (void) drawRect:(NSRect)rect +{ + PuglWrapperView* wrapper = (PuglWrapperView*)[self superview]; + [wrapper dispatchExpose:rect]; +} + @end static int diff --git a/pugl/detail/mac_gl.m b/pugl/detail/mac_gl.m index 4a6e39a..6cdf6f6 100644 --- a/pugl/detail/mac_gl.m +++ b/pugl/detail/mac_gl.m @@ -91,6 +91,12 @@ typedef NSUInteger NSWindowStyleMask; [wrapper dispatchConfigure:[self bounds]]; } +- (void) drawRect:(NSRect)rect +{ + PuglWrapperView* wrapper = (PuglWrapperView*)[self superview]; + [wrapper dispatchExpose:rect]; +} + @end static int |