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

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


The following commit has been merged in the debian/unstable branch:
commit 77a3d9053e7d7733f575437d0a81c5cfcd6454e8
Author: cblu <cblu at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Dec 18 00:44:19 2003 +0000

    	Fixed:
    	<rdar://problem/3393758>: REGRESSION (85-100): Flash onKeyUp event non-functional
    	<rdar://problem/3479020>: REGRESSION (85-100): Safari sends plug-in key events to wrong instance of plug-in
    
            Reviewed by darin.
    
            * Plugins.subproj/WebBaseNetscapePluginView.h:
            * Plugins.subproj/WebBaseNetscapePluginView.m:
            (-[WebBaseNetscapePluginView sendEvent:]): set suspendKeyUpEvents to NO
            (-[WebBaseNetscapePluginView keyMessageForEvent:]): copied from CVS
            (-[WebBaseNetscapePluginView keyUp:]): if !suspendKeyUpEvents, send the keyUp event
            (-[WebBaseNetscapePluginView keyDown:]): set suspendKeyUpEvents to YES
            (-[WebBaseNetscapePluginView windowBecameKey:]): call SetUserFocusWindow
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@5826 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index d9f6826..1cf6448 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,19 @@
+2003-12-17  Chris Blumenberg  <cblu at apple.com>
+
+	Fixed:
+	<rdar://problem/3393758>: REGRESSION (85-100): Flash onKeyUp event non-functional
+	<rdar://problem/3479020>: REGRESSION (85-100): Safari sends plug-in key events to wrong instance of plug-in
+
+        Reviewed by darin.
+
+        * Plugins.subproj/WebBaseNetscapePluginView.h:
+        * Plugins.subproj/WebBaseNetscapePluginView.m:
+        (-[WebBaseNetscapePluginView sendEvent:]): set suspendKeyUpEvents to NO
+        (-[WebBaseNetscapePluginView keyMessageForEvent:]): copied from CVS
+        (-[WebBaseNetscapePluginView keyUp:]): if !suspendKeyUpEvents, send the keyUp event
+        (-[WebBaseNetscapePluginView keyDown:]): set suspendKeyUpEvents to YES
+        (-[WebBaseNetscapePluginView windowBecameKey:]): call SetUserFocusWindow
+
 2003-12-17  Darin Adler  <darin at apple.com>
 
         Reviewed by Richard.
diff --git a/WebKit/Plugins.subproj/WebBaseNetscapePluginView.h b/WebKit/Plugins.subproj/WebBaseNetscapePluginView.h
index 20812df..933a12d 100644
--- a/WebKit/Plugins.subproj/WebBaseNetscapePluginView.h
+++ b/WebKit/Plugins.subproj/WebBaseNetscapePluginView.h
@@ -33,6 +33,7 @@
 
     BOOL isStarted;
     BOOL inSetWindow;
+    BOOL suspendKeyUpEvents;
 
     int32 specifiedHeight;
     int32 specifiedWidth;
diff --git a/WebKit/Plugins.subproj/WebBaseNetscapePluginView.m b/WebKit/Plugins.subproj/WebBaseNetscapePluginView.m
index 29a0b33..4f73914 100644
--- a/WebKit/Plugins.subproj/WebBaseNetscapePluginView.m
+++ b/WebKit/Plugins.subproj/WebBaseNetscapePluginView.m
@@ -296,6 +296,8 @@ static OSStatus TSMEventHandler(EventHandlerCallRef inHandlerRef, EventRef inEve
 {
     ASSERT([self window]);
 
+    suspendKeyUpEvents = NO;
+    
     if (!isStarted) {
         return NO;
     }
@@ -571,18 +573,46 @@ static OSStatus TSMEventHandler(EventHandlerCallRef inHandlerRef, EventRef inEve
     // Do nothing so that other responders don't respond to the drag that initiated in this view.
 }
 
+- (UInt32)keyMessageForEvent:(NSEvent *)event
+{
+    NSData *data = [[event characters] dataUsingEncoding:CFStringConvertEncodingToNSStringEncoding(CFStringGetSystemEncoding())];
+    if (!data) {
+        return 0;
+    }
+    UInt8 characterCode;
+    [data getBytes:&characterCode length:1];
+    UInt16 keyCode = [event keyCode];
+    return keyCode << 8 | characterCode;
+}
+
 - (void)keyUp:(NSEvent *)theEvent
 {
     TSMProcessRawKeyEvent([theEvent _eventRef]);
+    
+    // TSM won't send keyUp events so we have to send them ourselves.
+    // Only send keyUp events after we receive the TSM callback because this is what plug-in expect from OS 9.
+    if (!suspendKeyUpEvents) {
+        EventRecord event;
+        
+        [self getCarbonEvent:&event withEvent:theEvent];
+        event.what = keyUp;
+        
+        if (event.message == 0) {
+            event.message = [self keyMessageForEvent:theEvent];
+        }
+        
+        [self sendEvent:&event];
+    }
 }
 
 - (void)keyDown:(NSEvent *)theEvent
 {
+    suspendKeyUpEvents = YES;
     TSMProcessRawKeyEvent([theEvent _eventRef]);
 }
 
 static OSStatus TSMEventHandler(EventHandlerCallRef inHandlerRef, EventRef inEvent, void *pluginView)
-{
+{    
     EventRef rawKeyEventRef;
     OSStatus status = GetEventParameter(inEvent, kEventParamTextInputSendKeyboardEvent, typeEventRef, NULL, sizeof(EventRef), NULL, &rawKeyEventRef);
     if (status != noErr) {
@@ -1127,6 +1157,7 @@ static OSStatus TSMEventHandler(EventHandlerCallRef inHandlerRef, EventRef inEve
     [self sendActivateEvent:YES];
     [self setNeedsDisplay:YES];
     [self restartNullEvents];
+    SetUserFocusWindow([[self window] windowRef]);
 }
 
 -(void)windowResignedKey:(NSNotification *)notification

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list