[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.15.1-1414-gc69ee75

tonikitoo at webkit.org tonikitoo at webkit.org
Thu Oct 29 20:48:38 UTC 2009


The following commit has been merged in the webkit-1.1 branch:
commit 1389c9ee685365847b2c50cbda1ada550f7237ec
Author: tonikitoo at webkit.org <tonikitoo at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Oct 20 09:54:29 2009 +0000

    [Qt] Infinite loop (leading to crash) when setting cursor in QGraphicsWebView
    https://bugs.webkit.org/show_bug.cgi?id=30549
    
    Patch by Antonio Gomes <tonikitoo at webkit.org> on 2009-10-19
    Reviewed by Ariya Hidayat.
    
    Patch reimplements QGraphicsItem's itemChange method, and make
    CursorChange event to be emitted after cursor has already been
    set.
    
    QWidget::setCursor send the event just after it sets the cursor,
    then patch makes both behaviors compatible.
    
    * Api/qgraphicswebview.cpp:
    (QGraphicsWebView::itemChange):
    * Api/qgraphicswebview.h:
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@49846 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit/qt/Api/qgraphicswebview.cpp b/WebKit/qt/Api/qgraphicswebview.cpp
index 7e485a0..90dc01d 100644
--- a/WebKit/qt/Api/qgraphicswebview.cpp
+++ b/WebKit/qt/Api/qgraphicswebview.cpp
@@ -246,6 +246,28 @@ bool QGraphicsWebView::sceneEvent(QEvent* event)
 
 /*! \reimp
 */
+QVariant QGraphicsWebView::itemChange(GraphicsItemChange change, const QVariant& value)
+{
+    switch (change) {
+    // Differently from QWebView, it is interesting to QGraphicsWebView to handle
+    // post mouse cursor change notifications. Reason: 'ItemCursorChange' is sent
+    // as the first action in QGraphicsItem::setCursor implementation, and at that
+    // item widget's cursor has not been effectively changed yet.
+    // After cursor is properly set (at 'ItemCursorHasChanged' emission time), we
+    // fire 'CursorChange'.
+    case ItemCursorChange:
+        return value;
+    case ItemCursorHasChanged:
+        QEvent event(QEvent::CursorChange);
+        QApplication::sendEvent(this, &event);
+        return value;
+    }
+
+    return QGraphicsWidget::itemChange(change, value);
+}
+
+/*! \reimp
+*/
 bool QGraphicsWebView::event(QEvent* event)
 {
     // Re-implemented in order to allows fixing event-related bugs in patch releases.
diff --git a/WebKit/qt/Api/qgraphicswebview.h b/WebKit/qt/Api/qgraphicswebview.h
index 26f7374..43cf59a 100644
--- a/WebKit/qt/Api/qgraphicswebview.h
+++ b/WebKit/qt/Api/qgraphicswebview.h
@@ -85,6 +85,7 @@ public:
     virtual void setGeometry(const QRectF& rect);
     virtual void updateGeometry();
     virtual void paint(QPainter*, const QStyleOptionGraphicsItem* options, QWidget* widget = 0);
+    virtual QVariant itemChange(GraphicsItemChange change, const QVariant& value);
     virtual bool event(QEvent*);
 
 public Q_SLOTS:
diff --git a/WebKit/qt/ChangeLog b/WebKit/qt/ChangeLog
index 7987613..f8a2b1f 100644
--- a/WebKit/qt/ChangeLog
+++ b/WebKit/qt/ChangeLog
@@ -1,3 +1,21 @@
+2009-10-19  Antonio Gomes  <tonikitoo at webkit.org>
+
+        Reviewed by Ariya Hidayat.
+
+        [Qt] Infinite loop (leading to crash) when setting cursor in QGraphicsWebView
+        https://bugs.webkit.org/show_bug.cgi?id=30549
+
+        Patch reimplements QGraphicsItem's itemChange method, and make
+        CursorChange event to be emitted after cursor has already been
+        set.
+
+        QWidget::setCursor send the event just after it sets the cursor,
+        then patch makes both behaviors compatible.
+
+        * Api/qgraphicswebview.cpp:
+        (QGraphicsWebView::itemChange):
+        * Api/qgraphicswebview.h:
+
 2009-10-19  Nate Chapin  <japhet at chromium.org>
 
         Unreviewed, build fix.

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list