[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.19-706-ge5415e9

eric at webkit.org eric at webkit.org
Thu Feb 4 21:26:13 UTC 2010


The following commit has been merged in the webkit-1.1 branch:
commit 7e2478f064ee064ce3f558d7e4b2d4f92c11f21d
Author: eric at webkit.org <eric at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Sat Jan 23 16:37:44 2010 +0000

    2010-01-23  Girish Ramakrishnan  <girish at forwardbias.in>
    
            Reviewed by Kenneth Rohde Christiansen.
    
            [Qt] Fix positioning of ComboBox popup in QGraphicsWebView.
    
            Wrap the popup in a QGraphicsProxyWidget, so that the popup
            transforms with the item.
    
            https://bugs.webkit.org/show_bug.cgi?id=33887
    
            * WebCoreSupport/QtFallbackWebPopup.cpp:
            (WebCore::QtFallbackWebPopupCombo::hidePopup):
            (WebCore::QtFallbackWebPopup::QtFallbackWebPopup):
            (WebCore::QtFallbackWebPopup::~QtFallbackWebPopup):
            (WebCore::QtFallbackWebPopup::show):
            * WebCoreSupport/QtFallbackWebPopup.h:
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@53769 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit/qt/ChangeLog b/WebKit/qt/ChangeLog
index 89200fc..6cca97c 100644
--- a/WebKit/qt/ChangeLog
+++ b/WebKit/qt/ChangeLog
@@ -1,3 +1,21 @@
+2010-01-23  Girish Ramakrishnan  <girish at forwardbias.in>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        [Qt] Fix positioning of ComboBox popup in QGraphicsWebView.
+        
+        Wrap the popup in a QGraphicsProxyWidget, so that the popup
+        transforms with the item.
+        
+        https://bugs.webkit.org/show_bug.cgi?id=33887
+
+        * WebCoreSupport/QtFallbackWebPopup.cpp:
+        (WebCore::QtFallbackWebPopupCombo::hidePopup):
+        (WebCore::QtFallbackWebPopup::QtFallbackWebPopup):
+        (WebCore::QtFallbackWebPopup::~QtFallbackWebPopup):
+        (WebCore::QtFallbackWebPopup::show):
+        * WebCoreSupport/QtFallbackWebPopup.h:
+
 2010-01-22  Peter Kasting  <pkasting at google.com>
 
         Not reviewed, backout.
diff --git a/WebKit/qt/WebCoreSupport/QtFallbackWebPopup.cpp b/WebKit/qt/WebCoreSupport/QtFallbackWebPopup.cpp
index 1edbce3..55ab671 100644
--- a/WebKit/qt/WebCoreSupport/QtFallbackWebPopup.cpp
+++ b/WebKit/qt/WebCoreSupport/QtFallbackWebPopup.cpp
@@ -1,4 +1,5 @@
 /*
+ * Copyright (C) 2010 Girish Ramakrishnan <girish at forwardbias.in>
  * Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies)
  *
  * This library is free software; you can redistribute it and/or
@@ -22,9 +23,13 @@
 
 #include "HostWindow.h"
 #include "PopupMenuClient.h"
+#include "qgraphicswebview.h"
 #include "QWebPageClient.h"
 #include <QAbstractItemView>
 #include <QApplication>
+#include <QGraphicsProxyWidget>
+#include <QGraphicsScene>
+#include <QGraphicsView>
 #include <QInputContext>
 #include <QMouseEvent>
 #include <QStandardItemModel>
@@ -55,6 +60,10 @@ void QtFallbackWebPopupCombo::hidePopup()
     }
 
     QComboBox::hidePopup();
+
+    if (QGraphicsProxyWidget* proxy = graphicsProxyWidget())
+        proxy->setVisible(false);
+
     if (!m_ownerPopup.m_popupVisible)
         return;
 
@@ -68,6 +77,7 @@ QtFallbackWebPopup::QtFallbackWebPopup()
     : QtAbstractWebPopup()
     , m_popupVisible(false)
     , m_combo(new QtFallbackWebPopupCombo(*this))
+    , m_proxy(0)
 {
     connect(m_combo, SIGNAL(activated(int)),
             SLOT(activeChanged(int)), Qt::QueuedConnection);
@@ -75,19 +85,31 @@ QtFallbackWebPopup::QtFallbackWebPopup()
 
 QtFallbackWebPopup::~QtFallbackWebPopup()
 {
-    delete m_combo;
+    // If we create a proxy, then the deletion of the proxy and the
+    // combo will be done by the proxy's parent (QGraphicsWebView)
+    if (!m_proxy)
+        delete m_combo;
 }
 
 void QtFallbackWebPopup::show()
 {
     populate();
-    m_combo->setParent(pageClient()->ownerWidget());
     m_combo->setCurrentIndex(currentIndex());
-
     QRect rect = geometry();
-    m_combo->setGeometry(QRect(rect.left(), rect.top(),
+    if (QGraphicsWebView *webView = qobject_cast<QGraphicsWebView*>(pageClient()->pluginParent())) {
+        if (!m_proxy) {
+            m_proxy = new QGraphicsProxyWidget(webView);
+            m_proxy->setWidget(m_combo);
+        } else
+            m_proxy->setVisible(true);
+        m_proxy->setGeometry(rect);
+    } else {
+        m_combo->setParent(pageClient()->ownerWidget());
+        m_combo->setGeometry(QRect(rect.left(), rect.top(),
                                rect.width(), m_combo->sizeHint().height()));
 
+    }
+
     QMouseEvent event(QEvent::MouseButtonPress, QCursor::pos(), Qt::LeftButton,
                       Qt::LeftButton, Qt::NoModifier);
     QCoreApplication::sendEvent(m_combo, &event);
diff --git a/WebKit/qt/WebCoreSupport/QtFallbackWebPopup.h b/WebKit/qt/WebCoreSupport/QtFallbackWebPopup.h
index 8fbec6f..3924bf6 100644
--- a/WebKit/qt/WebCoreSupport/QtFallbackWebPopup.h
+++ b/WebKit/qt/WebCoreSupport/QtFallbackWebPopup.h
@@ -23,6 +23,8 @@
 #include "QtAbstractWebPopup.h"
 #include <QComboBox>
 
+class QGraphicsProxyWidget;
+
 namespace WebCore {
 
 class QtFallbackWebPopupCombo;
@@ -43,6 +45,7 @@ private:
     friend class QtFallbackWebPopupCombo;
     bool m_popupVisible;
     QtFallbackWebPopupCombo* m_combo;
+    QGraphicsProxyWidget* m_proxy;
 
     void populate();
 };

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list