diff --git a/dlls/winemac.drv/cocoa_window.m b/dlls/winemac.drv/cocoa_window.m
index 7cb3459efb5296ab24c9800f22033465ec7576d9..a9290c34c8eb3f6bd203e8e3acdbe1490a844147 100644
--- a/dlls/winemac.drv/cocoa_window.m
+++ b/dlls/winemac.drv/cocoa_window.m
@@ -296,6 +296,7 @@ @interface WineContentView : NSView <NSTextInputClient>
 {
     NSMutableArray* glContexts;
     NSMutableArray* pendingGlContexts;
+    BOOL _everHadGLContext;
     BOOL _cachedHasGLDescendant;
     BOOL _cachedHasGLDescendantValid;
     BOOL clearedGlSurface;
@@ -306,6 +307,8 @@ @interface WineContentView : NSView <NSTextInputClient>
     int backingSize[2];
 }
 
+@property (readonly, nonatomic) BOOL everHadGLContext;
+
     - (void) addGLContext:(WineOpenGLContext*)context;
     - (void) removeGLContext:(WineOpenGLContext*)context;
     - (void) updateGLContexts;
@@ -358,6 +361,8 @@ - (void) windowDidDrawContent;
 
 @implementation WineContentView
 
+@synthesize everHadGLContext = _everHadGLContext;
+
     - (void) dealloc
     {
         [markedText release];
@@ -467,7 +472,7 @@ - (void) drawRect:(NSRect)rect
 
     - (void) addGLContext:(WineOpenGLContext*)context
     {
-        BOOL hadContext = [self hasGLContext];
+        BOOL hadContext = _everHadGLContext;
         if (!glContexts)
             glContexts = [[NSMutableArray alloc] init];
         if (!pendingGlContexts)
@@ -489,6 +494,7 @@ - (void) addGLContext:(WineOpenGLContext*)context
             [self setNeedsDisplay:YES];
         }
 
+        _everHadGLContext = YES;
         if (!hadContext)
             [self invalidateHasGLDescendant];
         [(WineWindow*)[self window] updateForGLSubviews];
@@ -496,11 +502,8 @@ - (void) addGLContext:(WineOpenGLContext*)context
 
     - (void) removeGLContext:(WineOpenGLContext*)context
     {
-        BOOL hadContext = [self hasGLContext];
         [glContexts removeObjectIdenticalTo:context];
         [pendingGlContexts removeObjectIdenticalTo:context];
-        if (hadContext && ![self hasGLContext])
-            [self invalidateHasGLDescendant];
         [(WineWindow*)[self window] updateForGLSubviews];
     }
 
@@ -519,16 +522,11 @@ - (void) updateGLContexts
         [self updateGLContexts:NO];
     }
 
-    - (BOOL) hasGLContext
-    {
-        return [glContexts count] || [pendingGlContexts count];
-    }
-
     - (BOOL) _hasGLDescendant
     {
         if ([self isHidden])
             return NO;
-        if ([self hasGLContext])
+        if (_everHadGLContext)
             return YES;
         for (WineContentView* view in [self subviews])
         {
@@ -2485,7 +2483,7 @@ - (void) updateColorSpace
         NSRect contentRect = [[self contentView] frame];
         BOOL coveredByGLView = FALSE;
         WineContentView* view = (WineContentView*)[[self contentView] hitTest:NSMakePoint(NSMidX(contentRect), NSMidY(contentRect))];
-        if ([view isKindOfClass:[WineContentView class]] && [view hasGLContext])
+        if ([view isKindOfClass:[WineContentView class]] && view.everHadGLContext)
         {
             NSRect frame = [view convertRect:[view bounds] toView:nil];
             if (NSContainsRect(frame, contentRect))