Skip to content

Instantly share code, notes, and snippets.

Created May 2, 2012 14:48
Show Gist options
  • Save anonymous/2577121 to your computer and use it in GitHub Desktop.
Save anonymous/2577121 to your computer and use it in GitHub Desktop.
diff --git a/Source/WebKit2/ChangeLog b/Source/WebKit2/ChangeLog
index ede6787..8b1c06f 100644
--- a/Source/WebKit2/ChangeLog
+++ b/Source/WebKit2/ChangeLog
@@ -1,3 +1,22 @@
+2012-05-02 Simon Hausmann <simon.hausmann@nokia.com>
+
+ [Qt] Fix vkb showing incorrect flags/keys when content changes
+
+ Reviewed by NOBODY (OOPS!).
+
+ When the editor state changes we have to inform the input method about changed
+ properties so that it can issue a new input method query. Otherwise it may use old values
+ from other QQuickItems or other incorrectly initialized data.
+
+ Also use isActiveFocus() instead of hasFocus() to detect whether we're actively focused.
+ This is also what QQuick uses internally to determine whether it can make calls to the input method
+ or not.
+
+ * UIProcess/qt/QtWebPageEventHandler.cpp:
+ (WebKit::QtWebPageEventHandler::inputPanelVisibleChanged):
+ (WebKit::QtWebPageEventHandler::updateTextInputState):
+ (WebKit::QtWebPageEventHandler::doneWithGestureEvent):
+
2012-05-02 Zalan Bujtas <zbujtas@gmail.com>
[Qt][WK2] Remove redundant updateViewportArguments() call from HTMLBodyElement::didNotifyDescendantInseretions()
diff --git a/Source/WebKit2/UIProcess/qt/QtWebPageEventHandler.cpp b/Source/WebKit2/UIProcess/qt/QtWebPageEventHandler.cpp
index 9ecc686..019adb1 100644
--- a/Source/WebKit2/UIProcess/qt/QtWebPageEventHandler.cpp
+++ b/Source/WebKit2/UIProcess/qt/QtWebPageEventHandler.cpp
@@ -394,7 +394,7 @@ void QtWebPageEventHandler::inputPanelVisibleChanged()
return;
// We only respond to the input panel becoming visible.
- if (!m_webView->hasFocus() || !qApp->inputPanel()->visible())
+ if (!m_webView->hasActiveFocus() || !qApp->inputPanel()->visible())
return;
const EditorState& editor = m_webPageProxy->editorState();
@@ -411,9 +411,11 @@ void QtWebPageEventHandler::updateTextInputState()
m_webView->setFlag(QQuickItem::ItemAcceptsInputMethod, editor.isContentEditable);
- if (!m_webView->hasFocus())
+ if (!m_webView->hasActiveFocus())
return;
+ qApp->inputPanel()->update(Qt::ImQueryInput);
+
// Ignore input method requests not due to a tap gesture.
if (!editor.isContentEditable)
setInputPanelVisible(false);
@@ -426,12 +428,12 @@ void QtWebPageEventHandler::doneWithGestureEvent(const WebGestureEvent& event, b
m_postponeTextInputStateChanged = false;
- if (!wasEventHandled || !m_webView->hasFocus())
+ if (!wasEventHandled || !m_webView->hasActiveFocus())
return;
+ qApp->inputPanel()->update(Qt::ImQueryInput);
const EditorState& editor = m_webPageProxy->editorState();
bool newVisible = editor.isContentEditable;
-
setInputPanelVisible(newVisible);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment