Reviewed by Darin.
authorkdecker@apple.com <kdecker@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 3 Jan 2008 17:15:14 +0000 (17:15 +0000)
committerkdecker@apple.com <kdecker@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 3 Jan 2008 17:15:14 +0000 (17:15 +0000)
        Fixed: <rdar://problem/5660603> QuickDraw plug-ins can cause a 100% reproducible assertion failure in AppKit (breaks Safari UI)

        * Plugins/WebBaseNetscapePluginView.mm:
        (-[WebBaseNetscapePluginView updateAndSetWindow]): Simplified an early return for non-QuickDraw plug-ins and switched
        to using the more NSView friendly version of lockFocus, lockFocusIfCanDraw.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@29126 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebKit/mac/ChangeLog
WebKit/mac/Plugins/WebBaseNetscapePluginView.mm

index cec6c31125c01bdc77de606fa05259402453e60c..c5536618885438718361f0b4d755b59c5f9bbe51 100644 (file)
@@ -1,3 +1,13 @@
+2008-01-02  Kevin Decker  <kdecker@apple.com>
+
+        Reviewed by Darin.
+        
+        Fixed: <rdar://problem/5660603> QuickDraw plug-ins can cause a 100% reproducible assertion failure in AppKit (breaks Safari UI)
+
+        * Plugins/WebBaseNetscapePluginView.mm:
+        (-[WebBaseNetscapePluginView updateAndSetWindow]): Simplified an early return for non-QuickDraw plug-ins and switched
+        to using the more NSView friendly version of lockFocus, lockFocusIfCanDraw.
+
 2008-01-01  David D. Kilzer  <ddkilzer@webkit.org>
 
         Reviewed by Dan.
index 3f221be7f6ad23dc984c6d945f2b62b001562aea..b84a6494b306aa5941146f009166858ef4c35c93 100644 (file)
@@ -1200,20 +1200,17 @@ static OSStatus TSMEventHandler(EventHandlerCallRef inHandlerRef, EventRef inEve
     // NPP_SetWindow() with an empty NPWindow struct.
     if (!isStarted)
         return;
-    if ((drawingModel == NPDrawingModelCoreGraphics || drawingModel == NPDrawingModelOpenGL)  && ![self canDraw])
+    if (drawingModel != NPDrawingModelQuickDraw && ![self canDraw])
         return;
     
-    BOOL needsFocus = [self window] && ([NSView focusView] != self);
-    if (needsFocus)
-        [self lockFocus];
-
+    BOOL didLockFocus = [NSView focusView] != self && [self lockFocusIfCanDraw];
     PortState portState = [self saveAndSetNewPortState];
     if (portState) {
         [self setWindowIfNecessary];
         [self restorePortState:portState];
         free(portState);
     }   
-    if (needsFocus)
+    if (didLockFocus)
         [self unlockFocus];
 }