src/3rdparty/webkit/WebCore/platform/qt/QWebPopup.cpp
branchRCL_3
changeset 5 d3bac044e0f0
parent 0 1918ee327afb
--- a/src/3rdparty/webkit/WebCore/platform/qt/QWebPopup.cpp	Fri Feb 19 23:40:16 2010 +0200
+++ b/src/3rdparty/webkit/WebCore/platform/qt/QWebPopup.cpp	Fri Mar 12 15:46:37 2010 +0200
@@ -26,6 +26,7 @@
 #include <QApplication>
 #include <QInputContext>
 #include <QMouseEvent>
+#include <QGraphicsProxyWidget>
 
 namespace WebCore {
 
@@ -35,7 +36,9 @@
 {
     Q_ASSERT(m_client);
 
+#if !defined(Q_WS_S60) && !defined(Q_WS_MAEMO_5)
     setFont(m_client->menuStyle().font().font());
+#endif
     connect(this, SIGNAL(activated(int)),
             SLOT(activeChanged(int)), Qt::QueuedConnection);
 }
@@ -43,9 +46,16 @@
 
 void QWebPopup::exec()
 {
+    // QCursor::pos() is not a great idea for a touch screen, but we don't need the coordinates
+    // as comboboxes with Qt on Maemo 5 come up in their full width on the screen.
+    // On the other platforms it's okay to use QCursor::pos().
+#if defined(Q_WS_MAEMO_5)
+    showPopup();
+#else
     QMouseEvent event(QEvent::MouseButtonPress, QCursor::pos(), Qt::LeftButton,
                       Qt::LeftButton, Qt::NoModifier);
     QCoreApplication::sendEvent(this, &event);
+#endif
 }
 
 void QWebPopup::showPopup()
@@ -67,6 +77,10 @@
     }
 
     QComboBox::hidePopup();
+    
+    if (QGraphicsProxyWidget* proxy = graphicsProxyWidget())
+        proxy->setVisible(false);
+
     if (!m_popupVisible)
         return;