Title: [115831] trunk/Source/WebKit2
Revision
115831
Author
[email protected]
Date
2012-05-02 07:55:40 -0700 (Wed, 02 May 2012)

Log Message

[Qt] Fix vkb showing incorrect flags/keys when content changes

Reviewed by Tor Arne Vestbø.

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):

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (115830 => 115831)


--- trunk/Source/WebKit2/ChangeLog	2012-05-02 14:37:41 UTC (rev 115830)
+++ trunk/Source/WebKit2/ChangeLog	2012-05-02 14:55:40 UTC (rev 115831)
@@ -1,3 +1,22 @@
+2012-05-02  Simon Hausmann  <[email protected]>
+
+        [Qt] Fix vkb showing incorrect flags/keys when content changes
+
+        Reviewed by Tor Arne Vestbø.
+
+        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  Kenneth Rohde Christiansen  <[email protected]>
 
         [Qt] Add initial QML documentation

Modified: trunk/Source/WebKit2/UIProcess/qt/QtWebPageEventHandler.cpp (115830 => 115831)


--- trunk/Source/WebKit2/UIProcess/qt/QtWebPageEventHandler.cpp	2012-05-02 14:37:41 UTC (rev 115830)
+++ trunk/Source/WebKit2/UIProcess/qt/QtWebPageEventHandler.cpp	2012-05-02 14:55:40 UTC (rev 115831)
@@ -394,7 +394,7 @@
         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 @@
 
     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 @@
 
     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);
 }
 
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to