winemac: Don't remove an OpenGL context from its view if we're only going to re-add it.

If the context is being made current with its existing view, just update it
before making it current.
This commit is contained in:
Ken Thomases 2014-01-14 01:25:05 -06:00 committed by Alexandre Julliard
parent 2cc5337940
commit 2963a2d4ab
1 changed files with 17 additions and 12 deletions

View File

@ -156,20 +156,25 @@ void macdrv_make_context_current(macdrv_opengl_context c, macdrv_view v)
if (context && view)
{
[context removeFromViews:NO];
macdrv_add_view_opengl_context(v, c);
if (context.needsUpdate)
{
context.needsUpdate = FALSE;
[context setView:view];
[context setLatentView:nil];
}
if (view == [context view] || view == [context latentView])
macdrv_update_opengl_context(c);
else
{
if ([context view])
[context clearDrawableLeavingSurfaceOnScreen];
[context setLatentView:view];
[context removeFromViews:NO];
macdrv_add_view_opengl_context(v, c);
if (context.needsUpdate)
{
context.needsUpdate = FALSE;
[context setView:view];
[context setLatentView:nil];
}
else
{
if ([context view])
[context clearDrawableLeavingSurfaceOnScreen];
[context setLatentView:view];
}
}
[context makeCurrentContext];