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

rjw rjw at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 08:52:43 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit 86c41f29ab854d2d295c22c1664dbd21c4305158
Author: rjw <rjw at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Mon Jul 26 23:25:19 2004 +0000

            Fixed 3739737.  When setting the focus to a NSView, set the focus
            carbon focus to kControlIndicatorPart.  kControlIndicatorPart is a
            placeholder value for use to indicate that Cocoa has the focus.
    
            Reviewed by Ken.
    
            * Carbon.subproj/CarbonWindowAdapter.m:
            (-[CarbonWindowAdapter makeFirstResponder:]):
            * Carbon.subproj/HIWebView.m:
            (Click):
            (SetFocusPart):
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@7128 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit/Carbon.subproj/CarbonWindowAdapter.m b/WebKit/Carbon.subproj/CarbonWindowAdapter.m
index cc5abad..ceab8c5 100644
--- a/WebKit/Carbon.subproj/CarbonWindowAdapter.m
+++ b/WebKit/Carbon.subproj/CarbonWindowAdapter.m
@@ -408,6 +408,35 @@ static OSStatus NSCarbonWindowHandleEvent(EventHandlerCallRef inEventHandlerCall
     if (!ignoreEvent) [super sendEvent:inEvent];
 }
 
+- (BOOL)makeFirstResponder:(NSResponder *)aResponder
+{
+    // Let NSWindow focus the appropriate NSView.
+    if (![super makeFirstResponder:aResponder])
+        return NO;
+
+    // Now, if the view we're focusing is in a HIWebView, find the
+    // corresponding HIWebView for the NSView, and tell carbon to
+    // clear any focused control.
+    HIViewRef viewRef = 0;
+    NSResponder *firstResponder = [self firstResponder];    
+    if ([firstResponder isKindOfClass:[NSView class]]) {
+        NSView *view = (NSView *)firstResponder;
+        while (view) {
+            viewRef = [HIViewAdapter getHIViewForNSView:view];
+            if (viewRef)
+                break;
+            view = [view superview];
+        }
+    }
+
+    HIViewRef focus;
+    GetKeyboardFocus (_windowRef, &focus);
+    if (focus != viewRef) {
+        SetKeyboardFocus (_windowRef, viewRef, kControlIndicatorPart );
+    }
+
+    return YES;
+}
 
 // There's no override of _addCursorRect:cursor:forView:, despite the fact that NSWindow's invokes [self windowNumber], because Carbon windows won't have subviews, and therefore won't have cursor rects.
 
diff --git a/WebKit/Carbon.subproj/HIWebView.m b/WebKit/Carbon.subproj/HIWebView.m
index ffb1f59..84dd168 100644
--- a/WebKit/Carbon.subproj/HIWebView.m
+++ b/WebKit/Carbon.subproj/HIWebView.m
@@ -480,7 +480,6 @@ Click( HIWebView* inView, EventRef inEvent )
 {
 	CGSEventRecord			eventRec;
 	NSEvent*				kitEvent;
-	ControlRef				focus;
 //	NSView*					targ;
 	EventRef				newEvent;
 	Point					where;
@@ -511,14 +510,6 @@ Click( HIWebView* inView, EventRef inEvent )
 	
 	kitEvent = [[NSEvent alloc] _initWithCGSEvent:(CGSEventRecord)eventRec eventRef:(void *)newEvent];
 
-	// Grab the keyboard focus
-	// ¥¥¥ FIX: Need to switch to a real part code, not focusnextpart. Have to handle
-	//			subviews properly as well.
-
-	GetKeyboardFocus( GetWindowRef( inView ), &focus );
-	if ( focus != inView->fViewRef )
-		SetKeyboardFocus( GetWindowRef( inView ), inView->fViewRef, kControlFocusNextPart );
-
 //	targ = [[inView->fKitWindow _borderView] hitTest:[kitEvent locationInWindow]];
 
     if ( !inView->fIsComposited )
@@ -981,9 +972,11 @@ SetFocusPart(
 	else
 	{
 		// What's this?
-		check(false);
+                if (desiredFocus != kControlIndicatorPart) {
+                    check(false);
+                }
 		freshlyMadeFirstResponderView = nil;
-		partCodeToReturn = kControlFocusNoPart;
+		partCodeToReturn = desiredFocus;
     }
 
 	view->fFirstResponder = freshlyMadeFirstResponderView;
diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index 4e7d41d..08adea6 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,17 @@
+2004-07-26  Richard Williamson   <rjw at apple.com>
+
+        Fixed 3739737.  When setting the focus to a NSView, set the focus
+        carbon focus to kControlIndicatorPart.  kControlIndicatorPart is a
+        placeholder value for use to indicate that Cocoa has the focus.  
+	
+        Reviewed by Ken.
+
+        * Carbon.subproj/CarbonWindowAdapter.m:
+        (-[CarbonWindowAdapter makeFirstResponder:]):
+        * Carbon.subproj/HIWebView.m:
+        (Click):
+        (SetFocusPart):
+
 2004-07-26  Chris Blumenberg  <cblu at apple.com>
 
 	Fixed: <rdar://problem/3689734> dragging to an editable WebView does not scroll document

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list