From: Ken Thomases Subject: winemac: Defer attaching OpenGL context to a view which is zero-sized or outside its window's bounds. Message-Id: <9357DEBB-1008-43D1-872D-515CE59B7318@codeweavers.com> Date: Wed, 20 Nov 2013 15:35:37 -0600 That fails with the dread "invalid drawable" message. For . --- dlls/winemac.drv/cocoa_opengl.m | 7 ++++--- 1 files changed, 4 insertions(+), 3 deletions(-) diff --git a/dlls/winemac.drv/cocoa_opengl.m b/dlls/winemac.drv/cocoa_opengl.m index b773d7d..08e8d55 100644 --- a/dlls/winemac.drv/cocoa_opengl.m +++ b/dlls/winemac.drv/cocoa_opengl.m @@ -126,14 +126,15 @@ void macdrv_make_context_current(macdrv_opengl_context c, macdrv_view v) context.needsUpdate = FALSE; if (view) { - __block BOOL windowHasDevice; + __block BOOL viewIsValidDrawable; macdrv_add_view_opengl_context(v, c); OnMainThread(^{ - windowHasDevice = [[view window] windowNumber] > 0; + viewIsValidDrawable = [[view window] windowNumber] > 0 && + !NSIsEmptyRect([view visibleRect]); }); - if (windowHasDevice) + if (viewIsValidDrawable) { [context setView:view]; [context setLatentView:nil];