[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677

darin darin at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 07:24:25 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit 50486ea53b155202fa1f6f6206db64ff286ec003
Author: darin <darin at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Feb 11 23:10:06 2003 +0000

            Reviewed by Ed.
    
            - applied a fixed version of Ed Voas's change to make plug-ins position correctly
              inside Carbon metal windows; should have no effect on Safari
    
            * Plugins.subproj/WebBaseNetscapePluginView.m:
            (-[WebBaseNetscapePluginView saveAndSetPortStateForUpdate:]):
    	Don't assume that the Cocoa concept of the content view matches up with the Carbon
            concept of where the port is positioned. Instead, convert coordinates to border
            view coordinates, then back to Carbon content coordinates by using the delta between
            the port bounds and the port's pixmap bounds. Bug 3160710 was caused by an older version
            of this patch implicitly assuming the port bounds always had (0,0) for top left.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@3632 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index 5b11375..34ea804 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,18 @@
+2003-02-11  Darin Adler  <darin at apple.com>
+
+        Reviewed by Ed.
+
+        - applied a fixed version of Ed Voas's change to make plug-ins position correctly
+          inside Carbon metal windows; should have no effect on Safari
+
+        * Plugins.subproj/WebBaseNetscapePluginView.m:
+        (-[WebBaseNetscapePluginView saveAndSetPortStateForUpdate:]):
+	Don't assume that the Cocoa concept of the content view matches up with the Carbon
+        concept of where the port is positioned. Instead, convert coordinates to border
+        view coordinates, then back to Carbon content coordinates by using the delta between
+        the port bounds and the port's pixmap bounds. Bug 3160710 was caused by an older version
+        of this patch implicitly assuming the port bounds always had (0,0) for top left.
+
 2003-02-11  Trey Matteson  <trey at apple.com>
 
 	Set -seg1addr in our build styles, but not for the B&I build.
diff --git a/WebKit/Plugins.subproj/WebBaseNetscapePluginView.m b/WebKit/Plugins.subproj/WebBaseNetscapePluginView.m
index 829f6c0..2feeec9 100644
--- a/WebKit/Plugins.subproj/WebBaseNetscapePluginView.m
+++ b/WebKit/Plugins.subproj/WebBaseNetscapePluginView.m
@@ -143,13 +143,27 @@ typedef struct {
     WindowRef windowRef = [[self window] windowRef];
     CGrafPtr port = GetWindowPort(windowRef);
 
+    Rect portBounds;
+    GetPortBounds(port, &portBounds);
+
+    // Use AppKit to convert view coordinates to NSWindow coordinates.
+
     NSRect boundsInWindow = [self convertRect:[self bounds] toView:nil];
     NSRect visibleRectInWindow = [self convertRect:[self visibleRect] toView:nil];
     
-    // flip Y coordinates to convert NSWindow coordinates to Carbon window coordinates
-    float contentViewHeight = [[[self window] contentView] frame].size.height;
-    boundsInWindow.origin.y = contentViewHeight - boundsInWindow.origin.y - boundsInWindow.size.height; 
-    visibleRectInWindow.origin.y = contentViewHeight - visibleRectInWindow.origin.y - visibleRectInWindow.size.height;
+    // Flip Y to convert NSWindow coordinates to top-left-based window coordinates.
+
+    float borderViewHeight = [[self window] frame].size.height;
+    boundsInWindow.origin.y = borderViewHeight - NSMaxY(boundsInWindow);
+    visibleRectInWindow.origin.y = borderViewHeight - NSMaxY(visibleRectInWindow);
+    
+    // Look at the Carbon port to convert top-left-based window coordinates into top-left-based content coordinates.
+
+    PixMap *pix = *GetPortPixMap(port);
+    boundsInWindow.origin.x += pix->bounds.left - portBounds.left;
+    boundsInWindow.origin.y += pix->bounds.top - portBounds.top;
+    visibleRectInWindow.origin.x += pix->bounds.left - portBounds.left;
+    visibleRectInWindow.origin.y += pix->bounds.top - portBounds.top;
     
     // Set up NS_Port.
     
@@ -179,8 +193,6 @@ typedef struct {
     
     GetPort(&portState.oldPort);    
 
-    Rect portBounds;
-    GetPortBounds(port, &portBounds);
     portState.oldOrigin.h = portBounds.left;
     portState.oldOrigin.v = portBounds.top;
 

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list