Ken Thomases : winemac: Defer attaching OpenGL context to a view which is zero-sized or outside its window 's bounds.
Alexandre Julliard
julliard at winehq.org
Thu Nov 21 14:07:46 CST 2013
Module: wine
Branch: master
Commit: 682ed91017e6aa043feaf0c70a34118445e65d1e
URL: http://source.winehq.org/git/wine.git/?a=commit;h=682ed91017e6aa043feaf0c70a34118445e65d1e
Author: Ken Thomases <ken at codeweavers.com>
Date: Wed Nov 20 15:35:37 2013 -0600
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.
---
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 b678cae..45799db 100644
--- a/dlls/winemac.drv/cocoa_opengl.m
+++ b/dlls/winemac.drv/cocoa_opengl.m
@@ -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];
More information about the wine-cvs
mailing list