[SCM] WebKit Debian packaging branch, webkit-1.2, updated. upstream/1.1.90-6072-g9a69373

eric at webkit.org eric at webkit.org
Thu Apr 8 02:02:17 UTC 2010


The following commit has been merged in the webkit-1.2 branch:
commit 76cdf1c240f1cfb411e5ccf4988fe895f832af6d
Author: eric at webkit.org <eric at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Sat Feb 27 02:43:10 2010 +0000

    2010-02-26  Luiz Agostini  <luiz.agostini at openbossa.org>
    
            Reviewed by Kenneth Rohde Christiansen.
    
            Qt/Mac: Revert null timer removal (r51105)
            https://bugs.webkit.org/show_bug.cgi?id=35396
    
            r51105 removed the null timer event of the carbon event model. This however
            breaks the flash of many sites.
    
            Applying patch suggested by Girish Ramakrishnan in bug comment #1.
    
            * plugins/PluginView.h:
            * plugins/mac/PluginViewMac.cpp:
            (WebCore::PluginView::platformStart):
            (WebCore::PluginView::handleMouseEvent):
            (WebCore::PluginView::nullEventTimerFired):
            (WebCore::PluginView::mousePosForPlugin):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@55332 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 9e31679..0d5e6e9 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,22 @@
+2010-02-26  Luiz Agostini  <luiz.agostini at openbossa.org>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        Qt/Mac: Revert null timer removal (r51105)
+        https://bugs.webkit.org/show_bug.cgi?id=35396
+
+        r51105 removed the null timer event of the carbon event model. This however
+        breaks the flash of many sites.        
+
+        Applying patch suggested by Girish Ramakrishnan in bug comment #1.
+
+        * plugins/PluginView.h:
+        * plugins/mac/PluginViewMac.cpp:
+        (WebCore::PluginView::platformStart):
+        (WebCore::PluginView::handleMouseEvent):
+        (WebCore::PluginView::nullEventTimerFired):
+        (WebCore::PluginView::mousePosForPlugin):
+
 2010-02-26  Noam Rosenthal  <noam.rosenthal at nokia.com>
 
         Reviewed by Kenneth Rohde Christiansen.
diff --git a/WebCore/plugins/PluginView.h b/WebCore/plugins/PluginView.h
index c5cc012..f3eac9a 100644
--- a/WebCore/plugins/PluginView.h
+++ b/WebCore/plugins/PluginView.h
@@ -339,6 +339,7 @@ private:
         void setNPWindowIfNeeded();
 #elif defined(XP_MACOSX)
         NP_CGContext m_npCgContext;
+        OwnPtr<Timer<PluginView> > m_nullEventTimer;
         NPDrawingModel m_drawingModel;
         NPEventModel m_eventModel;
         CGContextRef m_contextRef;
@@ -347,8 +348,11 @@ private:
         QPixmap m_pixmap;
 #endif
 
+        Point m_lastMousePos;
         void setNPWindowIfNeeded();
+        void nullEventTimerFired(Timer<PluginView>*);
         Point globalMousePosForPlugin() const;
+        Point mousePosForPlugin(MouseEvent* event = 0) const;
 #endif
 
 #if defined(XP_UNIX) && ENABLE(NETSCAPE_PLUGIN_API)
diff --git a/WebCore/plugins/mac/PluginViewMac.cpp b/WebCore/plugins/mac/PluginViewMac.cpp
index d415d8f..82b6f3f 100644
--- a/WebCore/plugins/mac/PluginViewMac.cpp
+++ b/WebCore/plugins/mac/PluginViewMac.cpp
@@ -219,6 +219,12 @@ bool PluginView::platformStart()
 
     show();
 
+    // TODO: Implement null timer throttling depending on plugin activation
+    m_nullEventTimer.set(new Timer<PluginView>(this, &PluginView::nullEventTimerFired));
+    m_nullEventTimer->startRepeating(0.02);
+
+    m_lastMousePos.h = m_lastMousePos.v = 0;
+
     return true;
 }
 
@@ -578,7 +584,9 @@ void PluginView::handleMouseEvent(MouseEvent* event)
     EventRecord record;
 
     if (event->type() == eventNames().mousemoveEvent) {
-        record.what = nullEvent;
+        // Mouse movement is handled by null timer events
+        m_lastMousePos = mousePosForPlugin(event);
+        return;
     } else if (event->type() == eventNames().mouseoverEvent) {
         record.what = adjustCursorEvent;
     } else if (event->type() == eventNames().mouseoutEvent) {
@@ -594,21 +602,7 @@ void PluginView::handleMouseEvent(MouseEvent* event)
     } else {
         return;
     }
-
-    if (platformPluginWidget()) {
-        record.where = globalMousePosForPlugin();
-    } else {
-        if (event->button() == 2) {
-            // always pass the global position for right-click since Flash uses it to position the context menu
-            record.where = globalMousePosForPlugin();
-        } else {
-            IntPoint postZoomPos = roundedIntPoint(m_element->renderer()->absoluteToLocal(event->absoluteLocation()));
-            record.where.h = postZoomPos.x() + m_windowRect.x();
-            // The number 22 is the height of the title bar. As to why it figures in the calculation below 
-            // is left as an exercise to the reader :-)
-            record.where.v = postZoomPos.y() + m_windowRect.y() - 22;
-        }
-    }
+    record.where = mousePosForPlugin(event);
     record.modifiers = modifiersForEvent(event);
 
     if (!event->buttonDown())
@@ -700,6 +694,22 @@ void PluginView::handleKeyboardEvent(KeyboardEvent* event)
         event->setDefaultHandled();
 }
 
+void PluginView::nullEventTimerFired(Timer<PluginView>*)
+{
+    EventRecord record;
+
+    record.what = nullEvent;
+    record.message = 0;
+    record.when = TickCount();
+    record.where = m_lastMousePos;
+    record.modifiers = GetCurrentKeyModifiers();
+    if (!Button())
+        record.modifiers |= btnState;
+
+    if (!dispatchNPEvent(record))
+        LOG(Events, "PluginView::nullEventTimerFired(): Null event not accepted");
+}
+
 static int modifiersForEvent(UIEventWithKeyState* event)
 {
     int modifiers = 0;
@@ -756,6 +766,26 @@ Point PluginView::globalMousePosForPlugin() const
     return pos;
 }
 
+Point PluginView::mousePosForPlugin(MouseEvent* event) const
+{
+    ASSERT(event);
+    if (platformPluginWidget())
+        return globalMousePosForPlugin();
+
+    if (event->button() == 2) {
+        // always pass the global position for right-click since Flash uses it to position the context menu
+        return globalMousePosForPlugin();
+    }
+
+    Point pos;
+    IntPoint postZoomPos = roundedIntPoint(m_element->renderer()->absoluteToLocal(event->absoluteLocation()));
+    pos.h = postZoomPos.x() + m_windowRect.x();
+    // The number 22 is the height of the title bar. As to why it figures in the calculation below
+    // is left as an exercise to the reader :-)
+    pos.v = postZoomPos.y() + m_windowRect.y() - 22;
+    return pos;
+}
+
 bool PluginView::dispatchNPEvent(NPEvent& event)
 {
     PluginView::setCurrentPluginView(this);

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list