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

trey trey at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 07:22:14 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit af88a71bbfa24dd9a93dd25f759ff52afdf3c0b2
Author: trey <trey at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Jan 28 04:55:39 2003 +0000

    	3157146 REGRESSION: using a pop-up menu turns the cursor into an I-beam
    
     	A hack for the benefit of AK's PopUpButton, which uses the Carbon menu
    	manager, which thus eats all subsequent events after it is starts its
    	modal tracking loop.  After the interaction is done, we call a new routine
    	to fix things up in the khtml event world.  We post a fake mouse up to balance
    	the mouse down we started with.  In addition, we post a fake mouseMoved to get
    	the cursor in sync with whatever we happen to be over after the tracking is done.
    
            Reviewed by Darin.
    
            * kwq/KWQComboBox.mm:
            (-[KWQPopUpButtonCell trackMouse:inRect:ofView:untilMouseUp:]):
    	Call part after NSPopUp's modal tracking consumes events.
            * kwq/KWQKHTMLPart.h:
            * kwq/KWQKHTMLPart.mm:
            (KWQKHTMLPart::doFakeMouseUpAfterWidgetTracking):  New routine to allow widgets
    	to get out event state fixed up after a modal tracking loop.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@3472 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog-2003-10-25 b/WebCore/ChangeLog-2003-10-25
index b3fb17f..3398e1a 100644
--- a/WebCore/ChangeLog-2003-10-25
+++ b/WebCore/ChangeLog-2003-10-25
@@ -1,3 +1,24 @@
+2003-01-27  Trey Matteson  <trey at apple.com>
+
+	3157146 REGRESSION: using a pop-up menu turns the cursor into an I-beam
+
+ 	A hack for the benefit of AK's PopUpButton, which uses the Carbon menu
+	manager, which thus eats all subsequent events after it is starts its
+	modal tracking loop.  After the interaction is done, we call a new routine
+	to fix things up in the khtml event world.  We post a fake mouse up to balance
+	the mouse down we started with.  In addition, we post a fake mouseMoved to get
+	the cursor in sync with whatever we happen to be over after the tracking is done.
+
+        Reviewed by Darin.
+
+        * kwq/KWQComboBox.mm:
+        (-[KWQPopUpButtonCell trackMouse:inRect:ofView:untilMouseUp:]):
+	Call part after NSPopUp's modal tracking consumes events.
+        * kwq/KWQKHTMLPart.h:
+        * kwq/KWQKHTMLPart.mm:
+        (KWQKHTMLPart::doFakeMouseUpAfterWidgetTracking):  New routine to allow widgets
+	to get out event state fixed up after a modal tracking loop.
+
 2003-01-27  Chris Blumenberg  <cblu at apple.com>
 
 	Fixed: 3152053 - Safari: Java 141: Only visible applets are instantiated on web page
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index b3fb17f..3398e1a 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,24 @@
+2003-01-27  Trey Matteson  <trey at apple.com>
+
+	3157146 REGRESSION: using a pop-up menu turns the cursor into an I-beam
+
+ 	A hack for the benefit of AK's PopUpButton, which uses the Carbon menu
+	manager, which thus eats all subsequent events after it is starts its
+	modal tracking loop.  After the interaction is done, we call a new routine
+	to fix things up in the khtml event world.  We post a fake mouse up to balance
+	the mouse down we started with.  In addition, we post a fake mouseMoved to get
+	the cursor in sync with whatever we happen to be over after the tracking is done.
+
+        Reviewed by Darin.
+
+        * kwq/KWQComboBox.mm:
+        (-[KWQPopUpButtonCell trackMouse:inRect:ofView:untilMouseUp:]):
+	Call part after NSPopUp's modal tracking consumes events.
+        * kwq/KWQKHTMLPart.h:
+        * kwq/KWQKHTMLPart.mm:
+        (KWQKHTMLPart::doFakeMouseUpAfterWidgetTracking):  New routine to allow widgets
+	to get out event state fixed up after a modal tracking loop.
+
 2003-01-27  Chris Blumenberg  <cblu at apple.com>
 
 	Fixed: 3152053 - Safari: Java 141: Only visible applets are instantiated on web page
diff --git a/WebCore/kwq/KWQComboBox.mm b/WebCore/kwq/KWQComboBox.mm
index 4bac99e..3d226e9 100644
--- a/WebCore/kwq/KWQComboBox.mm
+++ b/WebCore/kwq/KWQComboBox.mm
@@ -28,6 +28,10 @@
 #import "KWQKHTMLPart.h"
 #import "WebCoreBridge.h"
 
+#import "khtmlview.h"
+#import "render_replaced.h"
+using khtml::RenderWidget;
+
 // We empirically determined that combo boxes have these extra pixels on all
 // sides. It would be better to get this info from AppKit somehow.
 #define TOP_MARGIN 1
@@ -218,6 +222,13 @@ int QComboBox::currentItem() const
     if (!wasDeferringLoading) {
         [bridge setDefersLoading:NO];
     }
+    if (result) {
+        // Give khtml a chance to fix up its event state, since the popup eats all the
+        // events during tracking.  [NSApp currentEvent] is still the original mouseDown
+        // at this point!
+        RenderWidget *renderWidget = dynamic_cast<RenderWidget *>(const_cast<QObject *>(widget->eventFilterObject()));
+        KWQ(renderWidget->view()->part())->doFakeMouseUpAfterWidgetTracking(event);
+    }
     return result;
 }
 
diff --git a/WebCore/kwq/KWQKHTMLPart.h b/WebCore/kwq/KWQKHTMLPart.h
index cb25dd8..63ef2ca 100644
--- a/WebCore/kwq/KWQKHTMLPart.h
+++ b/WebCore/kwq/KWQKHTMLPart.h
@@ -158,6 +158,7 @@ public:
     void mouseDown(NSEvent *);
     void mouseDragged(NSEvent *);
     void mouseUp(NSEvent *);
+    void doFakeMouseUpAfterWidgetTracking(NSEvent *downEvent);
     void mouseMoved(NSEvent *);
     bool keyEvent(NSEvent *);
     
diff --git a/WebCore/kwq/KWQKHTMLPart.mm b/WebCore/kwq/KWQKHTMLPart.mm
index 995f9d2..8a59068 100644
--- a/WebCore/kwq/KWQKHTMLPart.mm
+++ b/WebCore/kwq/KWQKHTMLPart.mm
@@ -1178,6 +1178,42 @@ void KWQKHTMLPart::mouseUp(NSEvent *event)
     _mouseDownView = nil;
 }
 
+/*
+ A hack for the benefit of AK's PopUpButton, which uses the Carbon menu manager, which thus
+ eats all subsequent events after it is starts its modal tracking loop.  After the interaction
+ is done, this routine is used to fix things up.  We post a fake mouse up to balance the
+ mouse down we started with.  In addition, we post a fake mouseMoved to get the cursor in sync
+ with whatever we happen to be over after the tracking is done.
+ */
+void KWQKHTMLPart::doFakeMouseUpAfterWidgetTracking(NSEvent *downEvent)
+{
+    _sendingEventToSubview = false;
+    ASSERT([downEvent type] == NSLeftMouseDown);
+    NSEvent *fakeEvent = [NSEvent mouseEventWithType:NSLeftMouseUp
+                                            location:[downEvent locationInWindow]
+                                       modifierFlags:[downEvent modifierFlags]
+                                           timestamp:[downEvent timestamp]
+                                        windowNumber:[downEvent windowNumber]
+                                             context:[downEvent context]
+                                         eventNumber:[downEvent eventNumber]
+                                          clickCount:[downEvent clickCount]
+                                            pressure:[downEvent pressure]];
+    mouseUp(fakeEvent);
+    // FIXME:  We should really get the current modifierFlags here, but there's no way to poll
+    // them in Cocoa, and because the event stream was stolen by the Carbon menu code we have
+    // no up-to-date cache of them anywhere.
+    fakeEvent = [NSEvent mouseEventWithType:NSMouseMoved
+                                   location:[[_bridge window] convertScreenToBase:[NSEvent mouseLocation]]
+                              modifierFlags:[downEvent modifierFlags]
+                                  timestamp:[downEvent timestamp]
+                               windowNumber:[downEvent windowNumber]
+                                    context:[downEvent context]
+                                eventNumber:0
+                                 clickCount:0
+                                   pressure:0];
+    mouseMoved(fakeEvent);
+}
+
 void KWQKHTMLPart::mouseMoved(NSEvent *event)
 {
     if (!d->m_view) {

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list