From 712eece4e399fe5ca916ecf7b6d77fdddddbf7fe Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Thu, 1 Oct 2009 16:59:28 +0000 Subject: Make Software Input Panel requests work with QGraphicsWebView _and_ QWebView by sharing the event code in handleSoftwareInputPanel(). MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Patch by Simon Hausmann on 2009-10-01 Reviewed by Tor Arne Vestbø. * Api/qwebpage.cpp: (QWebPagePrivate::mouseReleaseEvent): (QWebPagePrivate::handleSoftwareInputPanel): * Api/qwebpage_p.h: git-svn-id: http://svn.webkit.org/repository/webkit/trunk@48977 268f45cc-cd09-0410-ab3c-d52691b4dbfc --- src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp | 7 ++++++- src/3rdparty/webkit/WebKit/qt/Api/qwebpage_p.h | 1 + src/3rdparty/webkit/WebKit/qt/ChangeLog | 12 ++++++++++++ 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp b/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp index d1a4059..942c3ea 100644 --- a/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp +++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp @@ -764,10 +764,14 @@ void QWebPagePrivate::mouseReleaseEvent(QGraphicsSceneMouseEvent* ev) ev->setAccepted(accepted); handleClipboard(ev, ev->button()); + handleSoftwareInputPanel(ev->button()); +} +void QWebPagePrivate::handleSoftwareInputPanel(Qt::MouseButton button) +{ #if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0) if (view && view->testAttribute(Qt::WA_InputMethodEnabled) - && ev->button() == Qt::LeftButton && qApp->autoSipEnabled()) { + && button == Qt::LeftButton && qApp->autoSipEnabled()) { QStyle::RequestSoftwareInputPanel behavior = QStyle::RequestSoftwareInputPanel( view->style()->styleHint(QStyle::SH_RequestSoftwareInputPanel)); if (!clickCausedFocus || behavior == QStyle::RSIP_OnMouseClick) { @@ -794,6 +798,7 @@ void QWebPagePrivate::mouseReleaseEvent(QMouseEvent *ev) ev->setAccepted(accepted); handleClipboard(ev, ev->button()); + handleSoftwareInputPanel(ev->button()); } #ifndef QT_NO_CONTEXTMENU diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebpage_p.h b/src/3rdparty/webkit/WebKit/qt/Api/qwebpage_p.h index d41471a..b9571fa 100644 --- a/src/3rdparty/webkit/WebKit/qt/Api/qwebpage_p.h +++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebpage_p.h @@ -111,6 +111,7 @@ public: void shortcutOverrideEvent(QKeyEvent*); void leaveEvent(QEvent*); void handleClipboard(QEvent*, Qt::MouseButton); + void handleSoftwareInputPanel(Qt::MouseButton); bool handleScrolling(QKeyEvent*, WebCore::Frame*); void setInspector(QWebInspector*); diff --git a/src/3rdparty/webkit/WebKit/qt/ChangeLog b/src/3rdparty/webkit/WebKit/qt/ChangeLog index 8b9b14f..fd2768c 100644 --- a/src/3rdparty/webkit/WebKit/qt/ChangeLog +++ b/src/3rdparty/webkit/WebKit/qt/ChangeLog @@ -1,3 +1,15 @@ +2009-10-01 Simon Hausmann + + Reviewed by Tor Arne Vestbø. + + Make Software Input Panel requests work with QGraphicsWebView + _and_ QWebView by sharing the event code in handleSoftwareInputPanel(). + + * Api/qwebpage.cpp: + (QWebPagePrivate::mouseReleaseEvent): + (QWebPagePrivate::handleSoftwareInputPanel): + * Api/qwebpage_p.h: + 2009-10-01 Kristian Amlie Reviewed by Simon Hausmann. -- cgit v0.12