Commit 682ed910 authored by Ken Thomases's avatar Ken Thomases Committed by Alexandre Julliard

winemac: Defer attaching OpenGL context to a view which is zero-sized or outside…

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.
parent 3a2e8853
...@@ -123,14 +123,15 @@ void macdrv_make_context_current(macdrv_opengl_context c, macdrv_view v) ...@@ -123,14 +123,15 @@ void macdrv_make_context_current(macdrv_opengl_context c, macdrv_view v)
context.needsUpdate = FALSE; context.needsUpdate = FALSE;
if (view) if (view)
{ {
__block BOOL windowHasDevice; __block BOOL viewIsValidDrawable;
macdrv_add_view_opengl_context(v, c); macdrv_add_view_opengl_context(v, c);
OnMainThread(^{ OnMainThread(^{
windowHasDevice = [[view window] windowNumber] > 0; viewIsValidDrawable = [[view window] windowNumber] > 0 &&
!NSIsEmptyRect([view visibleRect]);
}); });
if (windowHasDevice) if (viewIsValidDrawable)
{ {
[context setView:view]; [context setView:view];
[context setLatentView:nil]; [context setLatentView:nil];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment