winemac: Defer attaching OpenGL context to a view which is zero-sized or outside its window's bounds.

That fails with the dread "invalid drawable" message.
This commit is contained in:
Ken Thomases 2013-11-20 15:35:37 -06:00 committed by Alexandre Julliard
parent 3a2e88534e
commit 682ed91017
1 changed files with 4 additions and 3 deletions

View File

@ -123,14 +123,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];