[Qt][WK2] Item cannot be selected from select list in touch webview
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 21 Mar 2012 11:43:40 +0000 (11:43 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 21 Mar 2012 11:43:40 +0000 (11:43 +0000)
https://bugs.webkit.org/show_bug.cgi?id=81674

Patch by Dinu Jacob <dinu.jacob@nokia.com> on 2012-03-21
Reviewed by Simon Hausmann.

Activate flag to prevent QQuickWebView from accepting touch event when select
dialog is being displayed.

* UIProcess/API/qt/qquickwebview.cpp:
(QQuickWebViewPrivate::QQuickWebViewPrivate):
(QQuickWebViewPrivate::execDialogRunner):
(QQuickWebView::touchEvent):
* UIProcess/API/qt/qquickwebview_p_p.h:
(QQuickWebViewPrivate::setDialogActive):
(QQuickWebViewPrivate):
* UIProcess/qt/WebPopupMenuProxyQt.cpp:
(WebKit::WebPopupMenuProxyQt::showPopupMenu):
(WebKit::WebPopupMenuProxyQt::hidePopupMenu):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@111523 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/API/qt/qquickwebview.cpp
Source/WebKit2/UIProcess/API/qt/qquickwebview_p_p.h
Source/WebKit2/UIProcess/qt/WebPopupMenuProxyQt.cpp

index 2b5dbf7b70f91b6fbc09109ccc369932f8ca77ff..288d72f26ae7840884ced869d33c54633996ffb7 100644 (file)
@@ -1,3 +1,24 @@
+2012-03-21  Dinu Jacob  <dinu.jacob@nokia.com>
+
+        [Qt][WK2] Item cannot be selected from select list in touch webview
+        https://bugs.webkit.org/show_bug.cgi?id=81674
+
+        Reviewed by Simon Hausmann.
+
+        Activate flag to prevent QQuickWebView from accepting touch event when select
+        dialog is being displayed.
+
+        * UIProcess/API/qt/qquickwebview.cpp:
+        (QQuickWebViewPrivate::QQuickWebViewPrivate):
+        (QQuickWebViewPrivate::execDialogRunner):
+        (QQuickWebView::touchEvent):
+        * UIProcess/API/qt/qquickwebview_p_p.h:
+        (QQuickWebViewPrivate::setDialogActive):
+        (QQuickWebViewPrivate):
+        * UIProcess/qt/WebPopupMenuProxyQt.cpp:
+        (WebKit::WebPopupMenuProxyQt::showPopupMenu):
+        (WebKit::WebPopupMenuProxyQt::hidePopupMenu):
+
 2012-03-21  Kenneth Rohde Christiansen  <kenneth@webkit.org>
 
         [Qt] Remove the PostTransitionState
index 8e17f186e41f8b99e433563487277b903ce88dfd..44a0d10a22f4c0301a0dea0c218381da0f76fede 100644 (file)
@@ -81,7 +81,7 @@ QQuickWebViewPrivate::QQuickWebViewPrivate(QQuickWebView* viewport)
     , m_navigatorQtObjectEnabled(false)
     , m_renderToOffscreenBuffer(false)
     , m_loadStartedSignalSent(false)
-    , m_dialogRunnerActive(false)
+    , m_dialogActive(false)
 {
     viewport->setFlags(QQuickItem::ItemClipsChildrenToShape);
     QObject::connect(viewport, SIGNAL(visibleChanged()), viewport, SLOT(_q_onVisibleChanged()));
@@ -366,10 +366,10 @@ void QQuickWebViewPrivate::execDialogRunner(QtDialogRunner& dialogRunner)
     setViewInAttachedProperties(dialogRunner.dialog());
 
     disableMouseEvents();
-    m_dialogRunnerActive = true;
+    m_dialogActive = true;
 
     dialogRunner.exec();
-    m_dialogRunnerActive = false;
+    m_dialogActive = false;
     enableMouseEvents();
 }
 
@@ -1325,7 +1325,7 @@ void QQuickWebView::focusOutEvent(QFocusEvent* event)
 void QQuickWebView::touchEvent(QTouchEvent* event)
 {
     Q_D(QQuickWebView);
-    if (d->m_dialogRunnerActive) {
+    if (d->m_dialogActive) {
         event->ignore();
         return;
     }
index 1d3aa97bfa35d8c4beff8a511a59c68079978239..5c6b6b63ae6ab0cf09ddb3775dec5fdb798f5c9e 100644 (file)
@@ -118,6 +118,8 @@ public:
 
     QRect visibleContentsRect() const;
 
+    void setDialogActive(bool active) { m_dialogActive = active; }
+
     // PageClient.
     WebCore::IntSize viewSize() const;
     void didReceiveMessageFromNavigatorQtObject(const String& message);
@@ -162,7 +164,7 @@ protected:
     bool m_navigatorQtObjectEnabled;
     bool m_renderToOffscreenBuffer;
     bool m_loadStartedSignalSent;
-    bool m_dialogRunnerActive;
+    bool m_dialogActive;
     QUrl m_iconURL;
     QUrl m_deferedUrlToLoad;
 };
index 4c0deadc2fead7f51a2775526cb4df7c5591819d..28b8accccda3f312c7b016a59e7a5e4056e6a3a3 100644 (file)
@@ -239,11 +239,13 @@ void WebPopupMenuProxyQt::showPopupMenu(const IntRect& rect, WebCore::TextDirect
         notifyValueChanged();
         return;
     }
+    QQuickWebViewPrivate::get(m_webView)->setDialogActive(true);
 }
 
 void WebPopupMenuProxyQt::hidePopupMenu()
 {
     m_itemSelector.clear();
+    QQuickWebViewPrivate::get(m_webView)->setDialogActive(false);
     m_context.clear();
     notifyValueChanged();
 }