[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:51:50 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit e03d32811edf6fcf3ecd41852c06e4a05244d654
Author: rjw <rjw at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Jul 20 20:41:44 2004 +0000

    		Fix for 3728558.  Fixed the key event handling in the carbon/cocoa
    		integration code.  This does not fix the arrow keys not working on
    		initial focus problem also mentioned in the bug.
    
    		Bumped the version of the NP function structures.
    
            Reviewed by John.
    
            * Carbon.subproj/CarbonUtils.m:
            (WebInitForCarbon):
            (PoolCleaner):
            * Carbon.subproj/HIWebView.m:
            (OwningWindowChanged):
            (WindowHandler):
            * Plugins.subproj/npapi.h:
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@7067 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit/Carbon.subproj/CarbonUtils.m b/WebKit/Carbon.subproj/CarbonUtils.m
index de16b3e..cd7caf6 100644
--- a/WebKit/Carbon.subproj/CarbonUtils.m
+++ b/WebKit/Carbon.subproj/CarbonUtils.m
@@ -17,6 +17,7 @@ static void				PoolCleaner( EventLoopTimerRef inTimer, EventLoopIdleTimerMessage
 
 static NSAutoreleasePool*	sPool;
 static unsigned numPools;
+static EventLoopRef poolLoop;
 
 static unsigned getNumPools()
 {
@@ -44,6 +45,8 @@ WebInitForCarbon()
         sPool = [[NSAutoreleasePool allocWithZone:NULL] init];
         numPools = getNumPools();
         
+        poolLoop = GetCurrentEventLoop ();
+
         InstallEventLoopIdleTimer( GetMainEventLoop(), 1.0, 0, PoolCleaner, 0, NULL );
         
         sAppKitLoaded = true;     
@@ -53,24 +56,30 @@ WebInitForCarbon()
 }
 
 
+/*
+    The pool cleaner is required because Carbon applications do not have
+    an autorelease pool provided by their event loops.  Importantly,
+    carbon applications that nest event loops, using any of the various
+    techniques available to Carbon apps, MUST create their our pools around
+    their nested event loops.
+*/
 static void
 PoolCleaner( EventLoopTimerRef inTimer, EventLoopIdleTimerMessage inState, void *inUserData )
 {
-	if ( inState == kEventLoopIdleTimerStarted )
-	{
+    if ( inState == kEventLoopIdleTimerStarted ) {
         CFStringRef mode = CFRunLoopCopyCurrentMode( (CFRunLoopRef)GetCFRunLoopFromEventLoop( GetCurrentEventLoop() ));
-        if ( CFEqual( mode, kCFRunLoopDefaultMode ) )
-        {
+        EventLoopRef thisLoop = GetCurrentEventLoop ();
+        if ( CFEqual( mode, kCFRunLoopDefaultMode ) && thisLoop == poolLoop) {
             unsigned currentNumPools = getNumPools()-1;            
             if (currentNumPools == numPools){
                 [sPool release];
+                
                 sPool = [[NSAutoreleasePool allocWithZone:NULL] init];
                 numPools = getNumPools();
             }
-
         }
         CFRelease( mode );
-	}
+    }
 }
 
 CGImageRef
diff --git a/WebKit/Carbon.subproj/HIWebView.m b/WebKit/Carbon.subproj/HIWebView.m
index c04d8a2..ffb1f59 100644
--- a/WebKit/Carbon.subproj/HIWebView.m
+++ b/WebKit/Carbon.subproj/HIWebView.m
@@ -727,7 +727,10 @@ OwningWindowChanged(
             { kEventClassMouse, kEventMouseMoved },
             { kEventClassMouse, kEventMouseUp },
             { kEventClassMouse, kEventMouseDragged },
-            { kEventClassMouse, kEventMouseWheelMoved }
+            { kEventClassMouse, kEventMouseWheelMoved },
+            { kEventClassKeyboard, kEventRawKeyDown },
+            { kEventClassKeyboard, kEventRawKeyRepeat },
+            { kEventClassKeyboard, kEventRawKeyUp }
             };
             
             view->fKitWindow = [[CarbonWindowAdapter alloc] initWithCarbonWindowRef: newWindow takingOwnership: NO disableOrdering:NO carbon:YES];
@@ -768,6 +771,38 @@ WindowHandler( EventHandlerCallRef inCallRef, EventRef inEvent, void* inUserData
 
     switch( GetEventClass( inEvent ) )
     {
+    	case kEventClassKeyboard:
+    		{
+                NSWindow*		kitWindow;
+                OSStatus		err;
+    			CGSEventRecord	eventRec;
+   				NSEvent*		kitEvent;
+   				
+   				// if the first responder in the kit window is something other than the
+   				// window, we assume a subview of the webview is focused. we must send
+   				// the event to the window so that it goes through the kit's normal TSM
+   				// logic, and -- more importantly -- allows any delegates associated
+   				// with the first responder to have a chance at the event.
+   				
+				err = GetWindowProperty( window, NSAppKitPropertyCreator, NSCarbonWindowPropertyTag, sizeof(NSWindow *), NULL, &kitWindow);
+				if ( err == noErr )
+				{
+					NSResponder* responder = [kitWindow firstResponder];
+					if ( responder != kitWindow )
+					{
+						GetEventPlatformEventRecord( inEvent, &eventRec );
+						RetainEvent( inEvent );
+						kitEvent = [[NSEvent alloc] _initWithCGSEvent:(CGSEventRecord)eventRec eventRef:(void *)inEvent];
+						
+						[kitWindow sendEvent:kitEvent];
+						[kitEvent release];
+						
+						result = noErr;
+					}
+				}
+    		}
+    		break;
+
         case kEventClassWindow:
             {
                 NSWindow*	kitWindow;
diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index b5f2eb5..f9ad72a 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,21 @@
+2004-07-20  Richard Williamson   <rjw at apple.com>
+
+		Fix for 3728558.  Fixed the key event handling in the carbon/cocoa
+		integration code.  This does not fix the arrow keys not working on
+		initial focus problem also mentioned in the bug.
+		
+		Bumped the version of the NP function structures.
+		
+        Reviewed by John.
+
+        * Carbon.subproj/CarbonUtils.m:
+        (WebInitForCarbon):
+        (PoolCleaner):
+        * Carbon.subproj/HIWebView.m:
+        (OwningWindowChanged):
+        (WindowHandler):
+        * Plugins.subproj/npapi.h:
+
 2004-07-20  Trey Matteson  <trey at apple.com>
 
 	3733698	REGRESSION: sometimes dragging photos on homepage.mac.com leads to an assertion
diff --git a/WebKit/Plugins.subproj/npapi.h b/WebKit/Plugins.subproj/npapi.h
index 585e2df..ec5e2e9 100644
--- a/WebKit/Plugins.subproj/npapi.h
+++ b/WebKit/Plugins.subproj/npapi.h
@@ -59,7 +59,7 @@
 /*----------------------------------------------------------------------*/
 
 #define NP_VERSION_MAJOR 0
-#define NP_VERSION_MINOR 11
+#define NP_VERSION_MINOR 12
 
 
 

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list